View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Faraz A. Qureshi Faraz A. Qureshi is offline
external usenet poster
 
Posts: 211
Default How to refer to a workbook?

I usually need to refer to other books during a macro. Lets consider a simple
sample as follows:

Sub SpclMcro()
Dim SrcWS As Worksheet
Dim DstWS As Worksheet
Dim SrcWB As Workbook
Dim Dst As Workbook
Dim Src As Range, Dest As Range
Set Src = Application.InputBox("WHAT?", , , , , , , 8)
Set Dest = Application.InputBox("WHERE?", , , , , , , 8)
MsgBox Src.Workbook.Name
Src.Copy Dest
End Sub

How can I get the name of the workbook of a cell/range as in:

MsgBox Src.Workbook.Name

Furthermore how to select a destination in ANY other workbook because during
the inputbox display of:

Set Dest = Application.InputBox("WHERE?", , , , , , , 8)

the workbook selection mode is inactive?

--
Thanx in advance,
Best Regards,

Faraz