cfree36
Board Regular
- Joined
- Oct 5, 2005
- Messages
- 175
I read that you can write VBA code using a sheet's code name rather than is sheet name or index... this way when someone changes the sheet name, or moves the sheet in the workbook the code still works.
So, I tried a couple of simple lines of code but am getting an error messgage.
Sheet3.Range("A1:B5").Select
returns an error of "Select Method of Range Class Failed"
However this code works:
Sheet3.Activate
ActiveSheet.Range("A1:B5").Select
I am wondering why? When I type the code the Auto List works... so I assume I am spelling things correctly??
So, I tried a couple of simple lines of code but am getting an error messgage.
Sheet3.Range("A1:B5").Select
returns an error of "Select Method of Range Class Failed"
However this code works:
Sheet3.Activate
ActiveSheet.Range("A1:B5").Select
I am wondering why? When I type the code the Auto List works... so I assume I am spelling things correctly??