workbook as variable

  • Thread starter Thread starter pete
  • Start date Start date
P

pete

for a newly created workbook, how can I store a reference to the
workbook in a variable ,

thanks

pete
 
Pete,

Try something like

Dim WB As Workbook
Set WB = ActiveWorkbook
' or
Set WB = Workbooks.Add()


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Pete,

Sub test()
Dim wkb As Workbook

Set wkb = Workbooks.Add
MsgBox wkb.FullName
End Sub

Rob
 
Back
Top