Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi.
A while back I recorded a macro to select a worksheet from one workbook, and then place that into another workbook. I'd like to take this to the next step where I choose the workbook. I have the following code, and get a " subscript out of range" error. Dim WkBkName As String Dim WkBkName1 As String ' Workbooks.Open Filename:= _ "C:\Documents and Settings\UserName\Application Data\Microsoft\Templates\TR Claim Book.xlt" _ , Editable:=True WkBkName = InputBox(Prompt:="enter workbook name of where to copy worksheet", Title:="Copy worksheet to existing workbook") WkBkName1 = "S:\Users Shared\UserName\DTR\Active Files\" & WkBkName & ".xlsx" Sheets("Tab # ").Select Workbooks(WkBkName1).Activate Sheets("Tab # ").Copy After:=Workbooks(WkBkName1).Sheets(Sheets.Count) When I click the debug button, and mouse over the line that's highlighted in yellow "Workbooks(WkBkName1).Activate" it shows the name of my file in a small message box. what am I missing? Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting Different Workbook | Excel Programming | |||
Selecting data from another workbook | Excel Programming | |||
Selecting data from 1 workbook to copy and paste to a 2nd workbook | Excel Programming | |||
Selecting a worksheet in a workbook | Excel Programming | |||
Selecting workbook | Excel Programming |