Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default counting number of entries for a date


Count number of rows/enties for the same DATE
I need a macro to count number of rows for the same date and displa
the result in the "Date number" Sheet.

It should pick up all the different date in the worksheet and coun
number of entries for that date and display the result

Sample Data:
08/07/2005
08/07/2005
08/07/2005
08/07/2005

10/07/2005
10/07/2005

Output:
08/07/2005 4
10/07/2005 2


Can anyone help me! Thank

--
kevinh
-----------------------------------------------------------------------
kevinhd's Profile: http://www.excelforum.com/member.php...fo&userid=2482
View this thread: http://www.excelforum.com/showthread.php?threadid=38552

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default counting number of entries for a date


Dim i As Long, lastRow As Long, rng As Range
Dim n As Long
Dim str As String
Dim count As Long

count = 0

Sheets("Route 1A (IN)").Select

lastRow = Range("A65536").End(xlUp).Row

Set rng = Range("C4:C" & lastRow) 'Start on row 4

If lastRow = 4 Or lastRow < 4 Then Exit Sub


For i = lastRow To 4 Step -1
n = 4
For n = lastRow To 4 Step -1
If (Range("C" & n) = Range("C" & n + 1)) Then
count = count + 1
Cells(4, 7).Value = count
Else
End If
Next n
Next i

This is what I've got, but doesn't work


--
kevinhd
------------------------------------------------------------------------
kevinhd's Profile: http://www.excelforum.com/member.php...o&userid=24828
View this thread: http://www.excelforum.com/showthread...hreadid=385521

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default counting number of entries for a date

On Fri, 8 Jul 2005 02:26:56 -0500, kevinhd
wrote:


Count number of rows/enties for the same DATE
I need a macro to count number of rows for the same date and display
the result in the "Date number" Sheet.

It should pick up all the different date in the worksheet and count
number of entries for that date and display the result

Sample Data:
08/07/2005
08/07/2005
08/07/2005
08/07/2005

10/07/2005
10/07/2005

Output:
08/07/2005 4
10/07/2005 2


Can anyone help me! Thanks


If the data is sorted as you show, my suggestion would be to record a macro
using the Data/Subtotals wizard and the Count function; then collapse the range
so you see only the counts. Use the GoTo Visible Cells option to select
appropriately; Copy/Paste and then stop the macro recording. Finally, do some
clean-up on the resultant macro.

If you have a lot of data, this should be faster than stepping through one at a
time.
--ron
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
Counting the number of different entries in a column Wombat Excel Discussion (Misc queries) 2 January 29th 10 10:58 AM
Counting the number of entries in a column Wombat Excel Discussion (Misc queries) 7 January 20th 10 02:20 PM
Counting entries by date mebsmith Excel Discussion (Misc queries) 2 August 27th 08 05:37 PM
Counting the number of date entries in a giving month Philgr Excel Discussion (Misc queries) 4 August 22nd 06 10:55 PM
Counting number of row entries BobD Excel Discussion (Misc queries) 1 June 21st 06 09:10 PM


All times are GMT +1. The time now is 10:46 AM.

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

About Us

"It's about Microsoft Excel"