i have very simple question about EXCEL automation. I want to ADD worksheets in the Workbook and also want to give names to these worksheet.![]()
After Adding these worksheets also want to use (reference) these sheets one by one.
VB Code:
ActiveWorkbook.Sheets.Add , , 20 For iLoop = 1 to 20 'ActiveWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count) Set wSheet = ActiveWorkbook.ActiveSheet wSheet.Name = sName & Format(iLoop, "00") Next
Problems that i am facing is that I could not get the reference of each sheet one by one ... so i can write data in that sheets.
And MOST important after running my code, when i directly open the EXCEL (2000) it display me 20 sheets, even before running this code, it was displaying only three sheets as normally dose. And i do not want to change the default settings of the EXCEL.
Thanx to all in advance.....




Reply With Quote