Excel VBA

fouling91

New Member
Joined
Oct 25, 2023
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
Hi every one;
I'm looking for a VBA code capable of copying data from columns "C2:D227612" and pasting them into empty rows in "A3:B227612". For example: range C2:D2 must be pasted into A3:B3 (empty row) and repeat this for all 227612 data. I need to put the Longitude-Latitude contained in columns C and D just below each Longitude-latitude combination in columns A. Can You Help Me please
Capture-data-copy.JPG
 
Slight adjustment to the code:

VBA Code:
Sub FillTheGaps()
    With ActiveSheet
        With Intersect(.UsedRange, .Range("A:B"))
            .SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C[2]"
            .Value = .Value
        End With
    End With
End Sub
It worked. Thank you very much😉
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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