LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Code with hidden flaw ERROR 400

On Thursday, March 28, 2013 6:55:15 PM UTC-7, GS wrote:
Howard,

The InputBox returns a Range object, and so your code has a fully

qualified ref to each range. Sooo...



CpyRngTo.Value = CpyRngFrom.Value



..is all you need.



--

Garry


Hi Garry,

CpyRngTo.Value = CpyRngFrm.Value

Your suggestion work well but copies to the same sheet it is copied
from. Needs to go to the other workbook named Copy WkBook TOO.

The only place the other workbook is mentioned is in the last line of
code. So the problem has to be there but danged if I can see why it
doesn't work.

Howard


This code...

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

...sets a fully qualified ref to the source range. (I'd name it
rngSource) It should also hold a ref to the workbook it belongs to, and
the sheet where the selection was made.

This code...

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

...sets a fully qualified ref to the target range. (I'd name it
rngTarget) It should also hold a ref to the workbook it belongs to, and
the sheet where the selection was made.

That precludes, then, that you only need to transfer the values between
the variables. If your target range is not in the correct workbook then
that's a user selection issue.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


 
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
Formula or Code to keep Hidden Rows Hidden Carol Excel Worksheet Functions 6 May 1st 07 11:45 PM
Code that keeps creating a toolbar - where might that code be hidden? Keith Excel Programming 4 February 12th 07 08:33 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Fatal Flaw Neal[_2_] Excel Programming 1 September 12th 03 09:24 PM


All times are GMT +1. The time now is 05:14 PM.

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"