move columns

donlincolnmre2

Board Regular
Joined
Dec 23, 2006
Messages
142
Hello

I'm looking for a macro that will move 9 digit numbers from column H and I to Column G.

Below is the dummy data.

colum G H I
======== ======= ========
9519290759 N
woodland 5304061176 N
REDONDO BEACH 3103795756 N
6503590602 N
9164421516 N
9163929631 N
9162949820 N
FAIR OAKS 9169888790 N
5302691239 N
LOS ANGELES 3106492634 N
SACRAMENTO 9163490333 N
9164184251 N
7602897799 N
9163769197 N
9164554192 N
4154531610 N
9167228248 N
9164081171 N
9163666199 N
ca alameda 5107420733
ca alameda 5103861997



The data can be seen here in the formatted format.


https://spreadsheets.google.com/spr...HlIQ2w4ZE0zT3Z0a1g2RDR0cjNiSVE&hl=en_US#gid=0


any help would be greaty appreciated.

Thanks.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Code:
Sub Macro1()
    
    Dim cell As Range, Lastrow As Long
    
    Lastrow = Cells.Find("*", , , , xlByRows, xlPrevious).Row
    
    For Each cell In Range("H2:I" & Lastrow).SpecialCells(xlCellTypeConstants, xlNumbers)
        Range("G" & cell.Row).Value = cell.Value
    Next cell
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,135
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top