Dear All,
could anyone please help me to change my named range cell reference, by using the codename of the particular sheet?
This is what works fine, but uses the name of the sheet:
ActiveWorkbook.Names("myRng").RefersTo = "='User123'!$B$39:$B$" & LastRow
where the "LastRow" is a variable, what changes.
I would like to create the same, but I need to use the codename of the sheet, which is: UserID
I tried this:
ActiveWorkbook.Names("myRng").RefersTo = "='" & UserID.Name & "'!$B$39:$B$" & LastRow
but it did not work.
Could you please help me?
Thank you in advance!
Happy Easter by the way!
Cheers,
Zs
could anyone please help me to change my named range cell reference, by using the codename of the particular sheet?
This is what works fine, but uses the name of the sheet:
ActiveWorkbook.Names("myRng").RefersTo = "='User123'!$B$39:$B$" & LastRow
where the "LastRow" is a variable, what changes.
I would like to create the same, but I need to use the codename of the sheet, which is: UserID
I tried this:
ActiveWorkbook.Names("myRng").RefersTo = "='" & UserID.Name & "'!$B$39:$B$" & LastRow
but it did not work.
Could you please help me?
Thank you in advance!
Happy Easter by the way!
Cheers,
Zs