Whenever I need a macro I just turn on the recorder, and sometimes I’m able to interpret and edit the results. But this one has me stumped.
I have .xls spreadsheet. The worksheet has a generic name (let’s say “Worksheet 1”.) I want the macro to select the contents of a cell on that worksheet – let’s say cell B12 contains some data that varies each time. I want the contents of B12, plus some hardcoded text value (for example “Results”), to become the name of the worksheet.
So if B12 contained “Q1 2015” I want the macro to change the name of the sheet from “Worksheet 1” to “Q1 2015 Results”
The results I get from the macro recorder seem to hardcode the B12 contents into the macro. It needs to be dynamic.
Thanks!