Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Kevin
one way: Sub increment_rows() Dim RowNdx As Long Dim LastRow As Long Dim counter As Long Application.ScreenUpdating = False counter = 1 LastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row For RowNdx = 1 To LastRow With Cells(RowNdx, "B") If .Value < "" Then .Offset(0, -1).Value = counter counter = counter + 1 End If End With Next RowNdx Application.ScreenUpdating = True End Sub also deals with blanks rows in between (they are skipped) -- Regards Frank Kabel Frankfurt, Germany "kevin" schrieb im Newsbeitrag ... sorry i should have said i am looking for a piece of code that does the same thing, like a loop that says if b has a value then a is cell above + 1 next i type thing. i am a novice but i know the code is relatively simple just don't know it. thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Running Tally | Excel Discussion (Misc queries) | |||
Running tally comparing two columns in unsorted list | Excel Discussion (Misc queries) | |||
how to keep a running tally of boxes filled with info | Excel Worksheet Functions | |||
formula to keep a running tally of the number of times a certain w | Excel Discussion (Misc queries) | |||
How Excel 2003 Highlight random cells and running tally appear? | Excel Discussion (Misc queries) |