Move numbers from one column to another

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
890
Dear all,
I am kindly require your support for a VBA code so that to run through col. "C28" (start) and rows down and where find numbers should place them in col."A" (A30) but exactly in description's adjacent cells. Please see below my original data. Thank you all in advance!
 

Attachments

  • clipboard-1726215488095.png
    clipboard-1726215488095.png
    16.2 KB · Views: 12

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I think this should work:
VBA Code:
sub movenumbers()
    Dim Code_rng as Range
    Set Code_rng = 'insert Range here

    Code_rng.Formula2R1C1 = "IF(ISNUMBER(RC[2]),RC[2],"""")"
    Code_rng.Value2 = Code_rng.Value2
end sub
 
Upvote 0
Thank you Mushy for your support. Unfortunately it doesn't work but therefore that I have a mistake where I have to determine the range. Note that the range should be C28:C14800 and if is number should place it in col. "A" next to description. Thank you once again. Have a nice day
 
Upvote 0
Thank you Mushy for your support. Unfortunately it doesn't work but therefore that I have a mistake where I have to determine the range. Note that the range should be C28:C14800 and if is number should place it in col. "A" next to description. Thank you once again. Have a nice day
They made a slight typo. There should be another "=" in front of the word "IF".

When I set the code like this, it ran successfully on your example:
Sub movenumbers()
VBA Code:
sub movenumbers()
    Dim Code_rng As Range
    Set Code_rng = Range("A29:A36")

    Code_rng.Formula2R1C1 = "=IF(ISNUMBER(RC[2]),RC[2],"""")"
    Code_rng.Value2 = Code_rng.Value2
   
End Sub
 
Last edited:
Upvote 0
Solution
You are welcome. Glad we could help.
I just had to make a few small edits to the code that Mushy peas posted.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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