Hi all the following code will put the worksheet name "SomeName" into
A1 to A10 on Sheet2.
'ThisWorkbook.Names.Add Name:="SomeName", _
' RefersTo:=Worksheets("Sheet2").Range("A1:A10")
I want to do the reverse. I want to use a string to define a Workbook name to activate. The workbook to be activated will be a variant in such the name
will always be what the value of the string.
Here's my attempt in which I'm getting a mismatch error:
Dim stFileName1 As String 'or Variant or Double or something else?
stFileName1 = Cells("O2").Value & "_" & "BOM.xls"
With ThisWorkbook
stAttachment = stPath & "\" & stFileName & ".xls"
End With
Workbooks(stFileName1).Activate
With ActiveWorkbook.Sheets(stFileName)
End With
NE HLP is Greatly Appreciated.
BDB
Bookmarks