Hi everyone, its my first post so be gentle!
I'm sure someone knows the answer to this but I haven't really used a huge amount of excel vba
I have a list of items in a testing document (several hundred functions to be tested) and need to make a detail sheet for each function to be tested. So far I have come up with a macro that will create the new sheet, move it to the end of the workbook, create all of the headers for the sheet, and perform some calculations on the new sheet.
The issue I am having is with the renaming of the sheet. I'm setting it up so you click on the function name to be tested, then run the macro.
It uses selection.copy first to pick up the name I've clicked on, then uses Sheets.Add to create the new sheet, then I'm using activesheet.name to rename the sheet.
Specifically I'm using:
It seems like the obvious way of doing it to me but it does nothing.
I have also tried:
Instead of returning the copied data, this just returns the value TRUE, and that is what it names the sheet!
Can anyone shed any light on this for me?
Thanks,
Twiss
p.s.
here is all the code just in case
I'm sure someone knows the answer to this but I haven't really used a huge amount of excel vba
I have a list of items in a testing document (several hundred functions to be tested) and need to make a detail sheet for each function to be tested. So far I have come up with a macro that will create the new sheet, move it to the end of the workbook, create all of the headers for the sheet, and perform some calculations on the new sheet.
The issue I am having is with the renaming of the sheet. I'm setting it up so you click on the function name to be tested, then run the macro.
It uses selection.copy first to pick up the name I've clicked on, then uses Sheets.Add to create the new sheet, then I'm using activesheet.name to rename the sheet.
Specifically I'm using:
Code:
activesheet.name = selection.paste
It seems like the obvious way of doing it to me but it does nothing.
I have also tried:
Code:
activesheet.name = activesheet.paste
Instead of returning the copied data, this just returns the value TRUE, and that is what it names the sheet!
Can anyone shed any light on this for me?
Thanks,
Twiss
p.s.
here is all the code just in case
Code:
Selection.Copy
Sheets.Add
ActiveSheet.Name = ActiveSheet.Paste
ActiveSheet.Move after:=Worksheets(Worksheets.Count)