Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Count Entries of Columns

How can you guys add to the following macro :


Dim Test_1
Dim Count_Test_1
Test_1 = Range("B5", "B" &
Range("B65536").End(xlUp).Row - 1)
Count_Test_1 = WorksheetFunction.Count(Test_1)
Range("B" & Range("B65536").End(xlUp).Row + 1) =
Count_Test_1



The above Macro counts the data in Column B and Display the result at
the bottom of the Column

problem is:

I need to Count all the entries of the adjacent Columns (i.e. Columns
C, D, E, F, G, H, I, ... , until end of Columns containing data)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Macro to Count Entries of Columns

Try this:

Sub AAAA()
Dim Test_1 As Range, Count_Test_1 As Long
Dim CurrCol As Integer, LR As Long
Range("B5").Activate
CurrCol = ActiveCell.Column
Do While Application.CountA(Columns(CurrCol)) 0
LR = Cells(Rows.Count, CurrCol).End(xlUp).Row
Set Test_1 = Range(ActiveCell, Cells(LR, CurrCol))
Count_Test_1 = WorksheetFunction.Count(Test_1)
Cells(LR + 1, CurrCol).Value = Count_Test_1
Cells(5, CurrCol + 1).Activate
CurrCol = ActiveCell.Column
Loop
Set Test_1 = Nothing
End Sub

Hope this helps,

Hutch

" wrote:

How can you guys add to the following macro :


Dim Test_1
Dim Count_Test_1
Test_1 = Range("B5", "B" &
Range("B65536").End(xlUp).Row - 1)
Count_Test_1 = WorksheetFunction.Count(Test_1)
Range("B" & Range("B65536").End(xlUp).Row + 1) =
Count_Test_1



The above Macro counts the data in Column B and Display the result at
the bottom of the Column

problem is:

I need to Count all the entries of the adjacent Columns (i.e. Columns
C, D, E, F, G, H, I, ... , until end of Columns containing data)

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
COUNT CONSECUTIVE ENTRIES IN COLUMNS micoz Excel Worksheet Functions 1 February 7th 10 04:04 PM
count entries tom ossieur Excel Worksheet Functions 7 November 7th 06 08:14 PM
Count entries in columns and rows Cliff Excel Worksheet Functions 3 April 6th 06 01:29 AM
How to align entries in columns so other columns will follow ? Artur Excel Programming 0 November 7th 05 08:10 AM
count entries within a row thewiz Excel Worksheet Functions 1 January 6th 05 09:57 PM


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

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"