Dragging data over without overwriting existing data.

DannyBidz

New Member
Joined
May 7, 2014
Messages
19
Hi All,

Please see the below example. Is there a way I can select the data in col. B and either cut / paste or drag over into col. A without overwriting the existing data in Col. A? So as to essentially just fill the gaps.

Dragging the Col. B items over one at a time will be rather time consuming for the list I have on my actual sheet.

AB
Colour
Blue
Red
Green
Yellow
Brown
Purple
Silver
Orange
Pink

<tbody>
</tbody>

Thanks for the help!

Cheers,

Dan.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Will col A always be blank if there is a value in col B?
 
Upvote 0
If the blanks and the value always line up like in your example this should work.



Code:
Sub fillblank()
Dim lr As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
For x = 2 To lr
    If Cells(x, "A") = "" Then Cells(x, "A") = Cells(x, "B")
Next x
Range("B2:B" & lr).ClearContents

End Sub
 
Upvote 0
If the answer to post#2 is yes, another option is
Code:
Sub DannyBidz()
   Range("A:A").SpecialCells(xlBlanks).Delete xlToLeft
End Sub
 
Upvote 0
If Blanks in Col A & values in col B won't always line up, try
Code:
Sub DannyBidz2()
   With Range("B:B").SpecialCells(xlConstants)
      .Copy Range("A" & Rows.Count).End(xlUp).Offset(1)
      Range("A:A").SpecialCells(xlBlanks).Delete xlUp
      .ClearContents
   End With
End Sub
 
Upvote 0
Hi folks, sorry it's took a while respond, and yes the values in col A will always be blank when there is a value in col B, so I shall try the options suggested.

Thank you so much for the help :)
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,220
Members
448,876
Latest member
Solitario

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