I want to copy, paste active sheet in excel workbook, and put the sheetname in editing mode (like double clicking on sheetname).
For this I'm currently using following macro with sendkeys. But when I run this macro, it changes the numlock & capslock state.
Public Sub CopySheet()
ActiveSheet.Copy
Application.SendKeys "%hor", True
End Sub
Is there any particular code/expression available to put the sheetname in editing mode (like double clicking on sheetname)?
you can use the code below, but pay attention when naming the sheet, the name must be unique, as it acts as an index in the collection sheets. If you try to duplicate the name of a sheet it will result in an error.