Move data from right 2 column to left column.

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.

The data can be seen here in the formatted format.

https://docs.google.com/document/d/1RRIfYb6UqQKAFtAV9EurWRITybjU5hX5h0nYce36sbA/edit?hl=en_US

any help would be greaty appreciated.

Thanks.



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
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Does this macro do what you want?
Code:
Sub MoveColumnsHIover()
  Dim A As Range
  For Each A In Columns("I").SpecialCells(xlCellTypeConstants).Areas
    A.Offset(, -1).Resize(, 2).Copy A.Offset(, -2)
    A.Clear
  Next
End Sub
 
Upvote 0
That links appears to be dead now, but I looked at the link you posted earlier and used that data in my tests for the macro... the macro performed correctly for me. Let me ask, just to be sure though... your cells are filled with constants, not formulas, correct?
 
Upvote 0
With you data in Columns G:I, this is what I get after I run the code I posted...
Code:
    G         H
----------   ---
9519290759    N
5304061176    N
3103795756    N
6503590602    N
9164421516    N
9163929631    N
9162949820    N
9169888790    N
5302691239    N
3106492634    N
9163490333    N
9164184251    N
7602897799    N
9163769197    N
9164554192    N
4154531610    N
9167228248    N
9164081171    N
9163666199    N
alameda       5107420733
alameda       5103861997
Isn't this the final format you were after?
 
Upvote 0
Your link is dead again. Hopefully, this link, when you revive it, will show the expected output for the sample data you posted earlier so I can see exactly what your words are describing.

By the way, you are saying 9-digit phone numbers, but the numbers in the sample data you posted all have 10 digits in them. Can you explain that and also tell us if you can have numbers that are not 9 (or is it 10) digits long mixed into those columns? In other words, if there is a number in Columns H or I, then that is a phone number that you want to move.
 
Upvote 0

Forum statistics

Threads
1,224,502
Messages
6,179,126
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