Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Need to fix this code to run on 2 columns.... (column A & B).
Any ideas? 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 | |||
Make Columns A&B on Sheet2 always equal Sheet1 table columns A&B | Setting up and Configuration of Excel | |||
create a macro to delete columns and then border remaining columns | Excel Programming | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
Pivot Table Creating New Columns that Subtract Two Existing Columns | Excel Discussion (Misc queries) |