Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I'm using an .xla to make modifications to another workbook. In my
procedure, I'm need to test the name of each worksheet to determine how to proceed. For some reason, I am unable to correctly point to capture the sheet name in the other workbook. I have tried a few different methods, none with any success. Here is the abbreviated code: Sub UnprotectSheets(strUpdateWb As String) 'where strUpdateWb is the name of an open workbook Windows(strUpdateWb).Activate Dim wb As Workbook Set wb = ActiveWorkbook 'Attempt #1 Dim temp As String temp = wb.Sheet1.Name MsgBox (temp) 'yields a run-time error. code stops. 'Attempt #2 temp = Sheet1.Name MsgBox (temp) 'gives me the sheet name from the xla. I need the sheet name from the xls workbook 'Attempt #3 temp = strUpdateWb.Sheet1.Name MsgBox (temp) 'run time error again End Sub Can anybody point me in the right direction? Thanks, Randy Eastland |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subset of one sheet on another sheet | Excel Discussion (Misc queries) | |||
Subset of one sheet on another sheet | Excel Worksheet Functions | |||
Impoting data from Sheet 1 to Sheet 2 | Excel Discussion (Misc queries) | |||
how can i select all the cells with same color on a sheet if there are multipale colors by vba code | Charts and Charting in Excel | |||
Naming & renaming a sheet tab | Excel Worksheet Functions |