tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,825
- Office Version
- 365
- 2019
- Platform
- Windows
Further to this discussion:
in particular mikerickson's response:
if the worksheet I am seeking is in another workbook, any code in that workbook cannot be password protected.
Why is that?
Thanks
Rich (BB code):
in particular mikerickson's response:
Rich (BB code):
Sub test()
MsgBox WorksheetCodeNamed("wksApples").Range("A1").Value
End Sub
Function WorksheetCodeNamed(wsCodeName As String, Optional wb As Workbook)
If wb Is Nothing Then Set wb = ActiveWorkbook
With wb
Set WorksheetCodeNamed = .Sheets(.VBProject.VBComponents(wsCodeName).Properties("index").Value)
End With
End Function
if the worksheet I am seeking is in another workbook, any code in that workbook cannot be password protected.
Why is that?
Thanks