How To Fill Blanks

jamiguel77

Active Member
Joined
Feb 14, 2006
Messages
387
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
  2. Web
InvoiceSerialPediment
110CAAA
110CAAA
110CAAA
110CAAA
110C
110C
110C
110C
110C
111B
111B
112GCCC
112GCCC
112GCCC
112G
112G
112G
112G


the result spected is:

InvoiceSerialPediment
110CAAA
110CAAA
110CAAA
110CAAA
110CAAA
110CAAA
110CAAA
110CAAA
110CAAA
111B
111B
112GCCC
112GCCC
112GCCC
112GCCC
112GCCC
112GCCC
112GCCC


note: row 11 and 12
not filled because in column C is empty

thanks
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
I have assumed that you are looking for a vba approach and would not use the code unless there were blank cells in column C.
Test with a copy of your worksheet.

VBA Code:
Sub Fill_Empty()
  With Range("C2:C" & Range("A" & Rows.Count).End(xlUp).Row)
    .SpecialCells(xlBlanks).FormulaR1C1 = "=IF(AND(RC[-1]=R[-1]C[-1],R[-1]C<>""""),R[-1]C,"""")"
    .Value = .Value
  End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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