LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
ann ann is offline
external usenet poster
 
Posts: 210
Default Cell Movement

Hi,

I have the following code that someone on this site wrote for me and I love
it and use it all the time. My problem is that this goes down the rows
looking for the city, state and zip code , finds it, selects the row, and
move backwards to select the rows above that I need. Then they are copied,
pasted (transposed) in the next columns over. I still need it to find the
city, state and zip code but select the cell they are in and then move to the
left by one cell, copy those two cells, and now when it pastes in the
adjacent columns I no longer need it to be transposed. I hope that makes
sense and I hope someone can help me.

Dim iRow As Long

For iRow = 1 To 32999

Range("A1").Select

Range("A" & iRow).Select
If Selection Like "*,?? ?????" Then

Range("A" & iRow & ":A" & iRow - 2).Select
Range("A" & iRow & ":A" & iRow - 2).Copy
Range("B" & iRow - 1 & ":B" & iRow - 1).PasteSpecial , , , True

End If
Next

Dim iRow As Long

For iRow = 1 To 160

Range("A1").Select

If iRow = 1 Then
Selection.EntireRow.Insert
End If

Range("A" & iRow).Select
If Selection Like "*,?? ?????" Then

Range("A" & iRow & ":A" & iRow - 2).Select
Range("A" & iRow & ":A" & iRow - 2).Copy
Range("B" & iRow - 1 & ":B" & iRow - 1).PasteSpecial , , , True

End If
Next
 
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
limited cell movement thebusinessbus Excel Worksheet Functions 2 February 5th 10 05:18 PM
Cell to cell movement with arrow keys moves entire sheet ken heinemann Excel Worksheet Functions 1 December 29th 06 12:30 AM
Force Cell Movement Jasmine Excel Discussion (Misc queries) 1 March 19th 05 12:06 AM
cell movement Jeff Lavendol Excel Programming 2 November 29th 04 09:43 PM
Incremental Cell Movement Weasel Excel Programming 2 September 5th 04 12:37 AM


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

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"