PC Review


Reply
Thread Tools Rate Thread

copy non adjacent cells

 
 
Member
Join Date: Sep 2009
Posts: 45
 
      3rd Oct 2009
I am trying to copy non adjacent cells in my excel 2002(windows xp) in a macro.
in an experiment the code statement
Range("A1:F1,I1,K1").Copy works and no error. But I have to use variables instead of A1,F1 etc . My code statement reads
(J is the row nummber)
Range(Range(Cells(j, "A"), Cells(j, "F")), Cells(j, "W"), c, Range("B1")).Copy

gives compile error on the first word "Range"
, the error message being "wrong number of arguments or invalid property assignment".

union (Range(Cells(j, "A"), Cells(j, "F")), Cells(j, "W"), c, Range("B1")).Copy

also gives runtime error

what is the mistake I am doing and also how to copy paste non adjacent cells in excel 2002. thanks

Last edited by venkat1926; 3rd Oct 2009 at 09:18 AM..
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy formulas from non-adjacent cells Mike O. Microsoft Excel Misc 0 22nd Oct 2009 06:21 PM
How to map cells to a reference then copy adjacent ones Dream Microsoft Excel Misc 4 8th Sep 2009 08:37 AM
How do I fill (copy) nonadjacent cells to adjacent cells? =?Utf-8?B?QnVja3lHZW9yZ2U=?= Microsoft Excel Misc 2 22nd Dec 2005 04:18 AM
Copy adjacent cells? Alan Microsoft Excel Discussion 2 2nd Dec 2004 06:39 PM
Copy non adjacent cells =?Utf-8?B?YUxCWQ==?= Microsoft Excel Worksheet Functions 1 24th Jan 2004 01:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:28 AM.