Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am currently using two identical codes (like below) to fill in
blanks in column A. (subsequent-identical code for Column B). Any ideas on combining them both? Need to run one code that fills in blanks in both columns A & B. Thanx. Sub FillColBlanksA() Dim wks As Worksheet Dim Rng As Range Dim lastrow As Long Dim col As Long Set wks = ActiveSheet With wks col = .Range("A1").Column Set Rng = .UsedRange lastrow = .Cells.SpecialCells(xlCellTypeLastCell).Row Set Rng = Nothing On Error Resume Next Set Rng = .Range(.Cells(2, col), .Cells(lastrow, col)) _ .Cells.SpecialCells(xlCellTypeBlanks) On Error GoTo 0 If Rng Is Nothing Then MsgBox "No blanks found" Exit Sub Else Rng.FormulaR1C1 = "=R[-1]C" End If With .Cells(1, col).EntireColumn .Value = .Value End With End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
help to adjust my code | Excel Programming | |||
Help to adjust code | Excel Programming | |||
HELP - I need to adjust code!!!! | Excel Programming | |||
Adjust a Scroll bar to fill in a range perfectly | Excel Programming |