Compare two columns

dunlopoil

Board Regular
Joined
May 29, 2008
Messages
92
Hi,
A very basic query for you: I have two columns of data, one of which (A) is entered completely. The other (B) has intermittent entries. I would like to fill in the blanks in column B with the entries in column A, but leave any data already entered in column B intact.
Thanks,
Doug.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi Doug,

What exactly are you filling the blanks with? Is it the value in Column A or is it a completely seperate calculation?
 
Upvote 0
Select column B, press F5 click Special, tick Blanks.

Press =

Press Left Arrow

Hold down CTRL and press Enter.

Then Copy, Edit > Paste Special > Values.

Or with a macro

Code:
Sub test()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
For i = 1 To LR
    If Range("B" & i).Value = "" Then Range("B" & i).Value = Range("A" & i).Value
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,995
Members
448,539
Latest member
alex78

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