ekrengel
04-13-2008, 03:15 PM
Does anyone know the proper way to rename the current sheet, and move to the next one for "VBscript"? I thought that this would work...but it isn't working properly. It renames the first sheet but doesn't go past the second.
intSheet = 1 'counter for sheets
objExcel.Sheets("Sheet" & intSheet).Select 'select current sheet
objExcel.Sheets("Sheet" & intSheet).Name = strComputer 'rename current sheet as the computername
intSheet = intSheet + 1 'counter to add next sheet
objExcel.Sheets("Sheet" & intSheet).Select 'go to the next sheet
intSheet = 1 'counter for sheets
objExcel.Sheets("Sheet" & intSheet).Select 'select current sheet
objExcel.Sheets("Sheet" & intSheet).Name = strComputer 'rename current sheet as the computername
intSheet = intSheet + 1 'counter to add next sheet
objExcel.Sheets("Sheet" & intSheet).Select 'go to the next sheet