Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a Development Notes template that I want to add to the front of larger
models that I build. Having saved the template as a file, I have code that is run from an icon that should - identify the activeworkbook - open the template file - copy the notes sheet into the activeworkbook - close the template file It keeps failing on the second of these two lines, with a 'Subscript out of range' error cSheet = Workbooks(cMainWin).Sheets(1).Name Workbooks(cNotesFile).Worksheets(cNotesFile).Copy Befo=Workbooks(cMainWin).Sheets(cSheet) ' cNotesFile is the name of the notes template ' cMainWin is the name of the activeworkbook The first line attempts to get the name of the first sheet in the file (I originally tried using Sheet(1) but with the same error) This should be straightforward, but clearly I'm making it more difficult than it should be - and making it fail at the same time. Any help would be appreciated -- If the post is helpful, please consider donating something to an animal charity on my behalf .......... and click Yes |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding a chart to large workbook brings workbook activity to a hal | Excel Discussion (Misc queries) | |||
Adding new work sheet to end of workbook | Excel Discussion (Misc queries) | |||
adding a new sheet to a formulated workbook | Excel Worksheet Functions | |||
Macro to prevent adding sheet in a workbook. | Excel Programming | |||
Excel, adding figures from one cell to a summary sheet or workbook | Excel Discussion (Misc queries) |