Hello everyone
I have data in column A and some cells are blanks .. In B1 there is a formula which I need to autofill till the last row but to skip the blank cells in column A
In other words, when cell in column A is blank no formula to be put in adjacent cell
Example : Say A16 is blank, So B16 has no formula
Hope it is clear
Autofill formula skipping adjacent blank cells



Re: Autofill formula skipping adjacent blank cells
How's this?
Code
Display MoreSub ApplyFormula() Dim blkRng As Range Dim lastRow As Long 'Figure out values lastRow = Cells(Rows.Count, "A").End(xlUp).Row Set blkRng = Range("A1:A" & lastRow).SpecialCells(xlCellTypeBlanks) Application.ScreenUpdating = False 'Apply formula Range("B1").AutoFill Range("B1:B" & lastRow) 'Clear blanks where needed blkRng.Offset(0, 1).ClearContents Application.ScreenUpdating = True End Sub


Re: Autofill formula skipping adjacent blank cells
Mr. Luke M
Mr. JindonThank you very much for these great solutions. You are very helful and awesome people
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!