Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
How can the following macro be modified to skip blank cells: Sub NumberCellsValue() Dim LastRow As Long With ActiveSheet Columns("A:A").Select Selection.Insert Shift:=xlToRight With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Selection.Font.Bold = False Selection.ColumnWidth = 5 LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row .Range("a1").Value = 1 With .Range("a2:a" & LastRow) .FormulaR1C1 = "=IF(RC[1]=R[-1]C[1],R[-1]C+1,1)" .Value = .Value End With .Range("a:a").NumberFormat = "000" End With Range("A1:A3").ClearContents Range("A1").Select End Sub Thank you for your help, jfcby |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete row if all cells are blank, Excel 2000 & 2003 | Excel Discussion (Misc queries) | |||
Number Cells, Excel 2000 & 2003 | Excel Programming | |||
Number Cells As Cell Value Changes, Excel 2000 & 2003 | Excel Programming | |||
I want to copy a formula n Excel but skip any blank cells | Excel Worksheet Functions | |||
How do I skip blank cells when copying over a range of cells? | Excel Discussion (Misc queries) |