Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
I have a list of names in column B, i want to write something that basically puts a number in column a if there is an entry in B so i have a running count e 1 AB 2 FG 3 XY any ideas pls. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
the following formulas will put a sequencing number in column A, if column B is filled: in A1 enter the following formula =IF(B1<"",1,"") in A2 enter the formula =IF(B2<"",MAX($A$1:OFFSET($A2,-1,0))+1,"") and copy this formula down for as many rows as you like -- Regards Frank Kabel Frankfurt, Germany "kevin" schrieb im Newsbeitrag ... hi, I have a list of names in column B, i want to write something that basically puts a number in column a if there is an entry in B so i have a running count eg 1 ABC 2 FGH 3 XYZ any ideas pls. |
#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. |
Reply |
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) |