Re: $$Excel-Macros$$ Sheets(2) refers to 2nd sheet in excell file not sheet with index2

2011-02-15 Thread Nasim
Thanks for your thorough explanation Paul. I now understand that sheets() points to the position of the sheet in the file. I still do not understand how to use the sheet.name though. This is what I have in objext explorer sheet1 (Process) 'is the first sheet sheet2 (Hours) ' is 3rd sheet sheet3

Re: $$Excel-Macros$$ Sheets(2) refers to 2nd sheet in excell file not sheet with index2

2011-02-15 Thread Paul Schreiner
The choice of which approch to use is really a question of Readability and Functionality. You can use: Sheet1.Select Sheet2.Select Sheet3.Select as long as you know you're not going to be deleting and adding sheets. Once you delete a sheet, even if you make a copy and delete the original, this

Re: $$Excel-Macros$$ Sheets(2) refers to 2nd sheet in excell file not sheet with index2

2011-02-15 Thread Nasim
Hi Paul, Thanks for your help. I think I now understand how it works. After I sent you the file I tried what is suggested in below link one more time and it works great. It is basically the same thing that you told me to do with a little bit of change. Here is the link for anybody interested:

Re: $$Excel-Macros$$ Sheets(2) refers to 2nd sheet in excell file not sheet with index2

2011-02-14 Thread Paul Schreiner
In your VBA Object Explorer, you'll see Sheet1(Name1) Sheet2(Name2) Sheet3(Name3) If you delete the sheet named Name2, create a new sheet, and call the NEW sheet Name2 It won't be: Sheet2(Name2), it'll be: Sheet4(Name2). So the LIST will be: Sheet1(Name1) Sheet3(Name3) Sheet4(Name4) in VBA