Paste contiguous list into non-contiguous cells.

jordanchenier14

New Member
Joined
Jan 12, 2022
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I have list that is current organized where all of the cells are directly on top of one another and I would like to paste the values into another spreadsheet, but only paste into specific cells. In the attached image I'd like to be able to take list A and then paste it into only blank cells of the next column. It's not a simple merge though, as the values don't align with the new paste area. Thank you in advance.


blank.xlsx
ABCDE
1List ADestination Desired Outcome
2
3100
421
5300
6400
752
863
9700
1084
11900
12105
1300
1400
1500
1600
176
1800
197
2000
218
2200
239
2400
2510
2600
Sheet1
 

Attachments

  • Excel Question.png
    Excel Question.png
    16.6 KB · Views: 1

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
What d you refer to, VBA or formula?
Paste to column E, or rewrite collumn C?
What columns in sheet1, and what columns in destination sheet?
 
Upvote 0
I want to take column A, paste it into column C so that when it's finished it looks like column E.
 
Upvote 0
It's an example. I just want to preserve the value and the order when it pastes into the empty cells of the desired column.
 
Upvote 0
Try:
VBA Code:
Option Explicit
Sub test()
Dim LrA&, LrC&, k&, cell As Range
With WorksheetFunction
LrA = Cells(Rows.Count, "A").End(xlUp).Row
LrC = LrA - .CountBlank(Range("C3:C" & Cells(Rows.Count, "C").End(xlUp).Row)) + Cells(Rows.Count, "C").End(xlUp).Row - 2
    For Each cell In Range("C3:C" & LrC)
        If cell = "" Then
            k = k + 1
            cell.Value = .Index(Range("A3:A" & LrA), k)
        End If
    Next
End With
End Sub
 
Upvote 0
Solution
Here is another macro that you can try...
VBA Code:
Sub Test()
  Dim R As Long, ListA As Variant, Blank As Range
  ListA = Range("A3", Range("A3").End(xlDown))
  On Error GoTo NoMoreData
  For Each Blank In Range("C3:C" & Rows.Count).SpecialCells(xlBlanks)
    R = R + 1
    Blank = ListA(R, 1)
  Next
NoMoreData:
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,545
Messages
6,120,128
Members
448,947
Latest member
test111

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