View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Copy FROM - TO Object/Block variable not set

Hi Howard,

try:
Sub CopyBookToBook()

Dim ColRngFrm As Range
Dim ColRngTo As Range

Set ColRngFrm = Application.InputBox(Prompt:="Enter a Copy from Range.",
_
Title:="Enter Copy from Column", Type:=8)
If ColRngFrm Is Nothing Then Exit Sub

Set ColRngTo = Application.InputBox(Prompt:="Enter a Copy to Range.", _
Title:="Enter Copy to Column", Type:=8)
If ColRngTo Is Nothing Then Exit Sub
MsgBox ColRngTo.Address

Workbooks("Copy To
WKBook.xlsm").Sheets("Sheet1").Range("ColRngTo").V alue = _
ThisWorkbook.Sheets("Sheet1").Range("ColRngFrm").V alue

End Sub

You can enter the range e.g. as A1:A5 or you select the range in the
workbook.



Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2