Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default workbook as variable

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

thanks

pete

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default workbook as variable

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" wrote in message
...
for a newly created workbook, how can I store a reference to

the
workbook in a variable ,

thanks

pete



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default workbook as variable

Pete,

Sub test()
Dim wkb As Workbook

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

Rob


"pete" wrote in message
...
for a newly created workbook, how can I store a reference to the
workbook in a variable ,

thanks

pete



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
pass variable from one workbook to another calebjill Excel Discussion (Misc queries) 2 January 28th 09 07:38 PM
Vlookup using a variable for the workbook name Phil Excel Discussion (Misc queries) 4 November 10th 08 09:30 PM
Can not set WorkBook variable jlclyde Excel Discussion (Misc queries) 5 March 6th 08 09:46 PM
How do I link to a workbook whose name is variable? Carl Borthwick Excel Discussion (Misc queries) 1 January 13th 06 10:01 AM
Activating workbook with variable Name Mark Klaus Excel Programming 2 October 24th 03 10:41 PM


All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"