Copy cell Value from One Column to the Fist blank cell in Another Column

SAMCRO2014

Board Regular
Joined
Sep 3, 2015
Messages
158
I am trying to loop through data and if the value in Column C is numeric than paste it in the first blank cell in Column D.

I know I have written code on this before but I can't seem to find the file. For the life of me, I can't figure it out now.

Any help?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Here is one way:
Code:
Sub MyCopyMacro()

    Dim lr As Long
    Dim r As Long
    
    Application.ScreenUpdating = False
    
'   Find last cell in column C with data
    lr = Cells(Rows.Count, "C").End(xlUp).Row
    
'   Loop through all rows in column C
    For r = 1 To lr
'       Check to see if value is numeric
        If IsNumeric(Cells(r, "C")) Then
'           Go to first blank cell in column D and paste value
            Cells(Rows.Count, "D").End(xlUp).Offset(1, 0) = Cells(r, "C")
        End If
    Next r
    
    Application.ScreenUpdating = True
            
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,306
Members
448,564
Latest member
ED38

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