![]() |
Referencing Worksheet code name in the following code
I am opening oWB and need to reference a worksheet code name in oWB. I have
the following: Set oRevisionWS = Nothing On Error Resume Next oWB.Activate oRevisionWS = Revisions <~~~worksheet code name On Error GoTo 0 I need to know how to define oRevisionWS to be the worksheet with the code name Revisions. Thanks, Barb Reinhardt |
Referencing Worksheet code name in the following code
Sub a()
Dim WS As Worksheet Dim oRevisionWS As Worksheet For Each WS In Worksheets If WS.CodeName = "Revisions" Then Set oRevisionWS = WS Exit For End If Next If Not oRevisionWS Is Nothing Then MsgBox oRevisionWS.Name End Sub -- Jim "Barb Reinhardt" wrote in message ... |I am opening oWB and need to reference a worksheet code name in oWB. I have | the following: | | Set oRevisionWS = Nothing | On Error Resume Next | oWB.Activate | oRevisionWS = Revisions <~~~worksheet code name | On Error GoTo 0 | | I need to know how to define oRevisionWS to be the worksheet with the code | name Revisions. | | Thanks, | Barb Reinhardt |
Referencing Worksheet code name in the following code
Thanks. This is one I just can't seem to remember how to do.
"Jim Rech" wrote: Sub a() Dim WS As Worksheet Dim oRevisionWS As Worksheet For Each WS In Worksheets If WS.CodeName = "Revisions" Then Set oRevisionWS = WS Exit For End If Next If Not oRevisionWS Is Nothing Then MsgBox oRevisionWS.Name End Sub -- Jim "Barb Reinhardt" wrote in message ... |I am opening oWB and need to reference a worksheet code name in oWB. I have | the following: | | Set oRevisionWS = Nothing | On Error Resume Next | oWB.Activate | oRevisionWS = Revisions <~~~worksheet code name | On Error GoTo 0 | | I need to know how to define oRevisionWS to be the worksheet with the code | name Revisions. | | Thanks, | Barb Reinhardt |
All times are GMT +1. The time now is 04:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com