Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default creating a running tally

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default creating a running tally

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default creating a running tally

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Tally accessnovice Excel Discussion (Misc queries) 1 August 13th 09 08:51 PM
Running tally comparing two columns in unsorted list OperationsNETTC15 Excel Discussion (Misc queries) 7 June 12th 09 04:27 AM
how to keep a running tally of boxes filled with info fireman175 Excel Worksheet Functions 1 May 8th 08 12:00 AM
formula to keep a running tally of the number of times a certain w CJZ Excel Discussion (Misc queries) 4 November 8th 06 01:04 AM
How Excel 2003 Highlight random cells and running tally appear? PULIDOC Excel Discussion (Misc queries) 1 April 28th 06 12:29 AM


All times are GMT +1. The time now is 08:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"