I need to reference few ranges on a worksheet named Invoice (Invoice), but sometimes its name changes to Invoice 1
How would I allow for either scenario?
Worksheets("Invoice").Range("A1") or Worksheets("Invoice 1").Range("A1")
I tried something like this thinking Invoice is the codename whether it is Invoice or Invoice 1, but it didn't work:
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Invoice")
ws(Invoice).Range("A1")