Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy a range to cells above range

Hello All,

This is my story.
I have 2 lists.
List 1, has UPDATED address info, List 2 has "out of date" addresses,
but current phone numbers.
I have combined the 2 lists and sorted them by Last Name, First Name.

Row 1 has John, Smith, (old)PO BOX, (old)City, (old)State, (old)zip,
phone number, cell phone
Row 2 has John Smith, (new)PO BOX, (new)City, (new)State, (new)Zip,
(blank)phone number, (blank)Cellphone

Every odd row has old address info and current phone info
Every even row has current addrerss info but no phone info

Not every odd row has phone info.
I also need to check for incorrect info, so i need a macro that i can
us on just 2 rows at a time.
This is what i have been doing: Select columns( of Row 2), copy, the
select same columns in Row 1, then Paste Special, Skip blanks.

This is working pretty good, but i have 20,000 rows to go through.
Is there a marco that could make this faster.
Bear in mind i need to be abel to nly check 2 rows at a time.

Thanks
Pete

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Copy a range to cells above range

Hi Pete,

Try this:

Sub CopyEvenToOdd()
'
Range("A2").Select
Do
Range(ActiveCell, ActiveCell.Offset(0, 8)).Select
Selection.Copy
ActiveCell.Offset(-1, 0).PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:=True, Transpose:=False
ActiveCell.Offset(3, 0).Select
Loop Until IsEmpty(ActiveCell)
Range("A1").Select
Application.CutCopyMode = False
End Sub

Hoop This Helps,


Executor

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy a range to cells above range

This should work just fine.
This shold give me enough code to work with. I dont need it to loop,
since there will be a few cases where the odd row and the even row are
not the same records. Of i could go into debug mode and step thorugh it
and just stop it when i come to a set of bad records.
Either way THANKS

Your QUICK help is very much APPRECIATED.

Thanks
Pete

Reply
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
Using VBA to copy range of cells JTF Excel Programming 3 August 17th 05 05:09 PM
Copy Range of Cells in Same Row Moe Excel Discussion (Misc queries) 1 August 4th 05 06:47 PM
copy range of cells using VB Stuart[_18_] Excel Programming 3 October 13th 04 06:51 PM
Copy a formula to a range of cells via VB6 using .Range(Cells(row,col), Cells(row,col)).Formula= statement Kevin Excel Programming 7 October 5th 04 08:11 PM
Copy a value to a range of cells Terence Excel Programming 2 October 2nd 03 02:23 AM


All times are GMT +1. The time now is 10:01 PM.

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

About Us

"It's about Microsoft Excel"