LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Copy FROM - TO Object/Block variable not set

On Monday, March 25, 2013 1:33:16 PM UTC-7, Claus Busch wrote:
Hi Howard,



Am Mon, 25 Mar 2013 13:09:26 -0700 (PDT) schrieb Howard:



When I select OR type in the Range To InputBox ($H$1:$H$5) I now get the Circled Red X error box & 400.




Seems to be happy with the select or type in range in the Copy From Input box however.




I have testet the code without any error. Both workbooks were opened.



But you can also try another code where you only enter a column letter:



Sub CopyBookToBook2()



Dim ColRngFrm As String

Dim ColRngTo As String

Dim LRow As Long



LRow = Cells(Rows.Count, 1).End(xlUp).Row



ColRngFrm = Application.InputBox(Prompt:="Enter a Copy from Range.", _

Title:="Enter Copy from Column", Type:=2)

If ColRngFrm = "" Or ColRngFrm = "False" Then Exit Sub



ColRngTo = Application.InputBox(Prompt:="Enter a Copy to Range.", _

Title:="Enter Copy to Column", Type:=2)

If ColRngTo = "" Or ColRngTo = "False" Then Exit Sub



Range(Cells(1, ColRngFrm), Cells(LRow, ColRngFrm)).Copy _

Workbooks("Copy to WKBook").Sheets("Sheet1").Cells(1, ColRngTo)



End Sub



If you want, I can upload the workbook with the code.





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2


I just test flew the column only code and it works like magic. I like!!
I'll change the wording in the InputBoxes to be specific to a column letter and not a Range.

Thanks. Appreciate your help, always top notch!

Regards,
Howard
 
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
Runtime Error 91 Object variable or With block variable not set. Tim Excel Programming 9 June 5th 08 10:03 PM
Run-Time error '91': Object variable of With block variable not set jammin1911 Excel Programming 3 June 6th 06 06:36 PM
Run-time Error'91: Object variable or With block variable not set DynamiteSkippy Excel Programming 4 September 26th 05 07:47 AM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 08:30 AM.

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

About Us

"It's about Microsoft Excel"