View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Syntax to define a variable for current file

Mervyn,

Try something like

Dim FName As String
FName = ActiveWorkbook.Name
' more code here
Workbooks(FName).Activate


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


"Mervyn Thomas" wrote in message
...
Can someone tell me how to define a variable to hold the name

of the current
file so that later I can reactivate the file by referring to

the variable
rather hard code its name?

Thanks - It escapes me !