I have code that resides on a page and references the content of the workbook. When executed from a different worksheet, I would like to get the name of the specific Worksheet containing the code.
I have worksheets that contain data. The code is added to that worksheet and the run - which produces a Summary worksheet. From the Summary worksheet, I would like to run the code on the data worksheet. This means I can't use ActiveSheet
and I would have to reference the data sheet by name.
How can I get the name of the worksheet containing the code without having to hard-code the name?
Use the "Me" object.
Me.Name is the property you seek, wich will give you the name of the sheet containing the code regardless the active sheet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With