View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Use the codename not the Excel name.

This is usually the same, Sheet1, Sheet2, etc, but it doesn't change if the
user changes the Excel name.

You use it like

Sheet1.Range("A1")

instead of

Worksheets("Sheet1").Range("A1")


--
HTH

Bob Phillips

"Jeff" wrote in message
...
I have a VBA code - that opens a worksheet, then gets data. The problem

is
that the worksheet name can change, then it won't open. Is there anyway

to
save the worksheet name as some variable, that can reference the worksheet
name/location + will automatically update?

Thanks