Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Changing this code ... Please advise

Hi Dana

It will give you all empty cells in the column.
If the OP want that I don't know?

If I use 100 rows of data and want to know how many are empty then
I don't want a answer of 65436 or more.



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dana DeLouis" wrote in message ...
Hello. Would this idea work?

Set Rng = Columns("A:A") 'Your Range here
With WorksheetFunction
Stuff = .CountA(Rng)
Blanks = .CountBlank(Rng)
End With

Dana DeLouis


"Ron de Bruin" wrote in message
...
Hi Dana

Maybe the OP have a other reason to use the range
But it is easy to get the blanks now

count = rng.Cells.count - Application.WorksheetFunction.CountA(rng)
MsgBox count



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dana DeLouis" wrote in message

...
Set rng = Range(Cells(1, 1), Cells(Rows.count, 1).End(xlUp))
count = Application.WorksheetFunction.CountA(rng)

I may have misunderstood the question, but I think this returns the same
number.

col = 1
count = WorksheetFunction.CountA(Columns(col))

HTH
Dana DeLouis


"Jako " wrote in message
...
I am using this code to count the number of cells in column A that are
NOT empty.

'-------------------------------------------------------------
Sub RowACount()
Dim rng As Range
Dim count As Long
Set rng = Range(Cells(1, 1), Cells(Rows.count, 1).End(xlUp))
count = Application.WorksheetFunction.CountA(rng)
MsgBox count
End Sub
'------------------------------------------------------------



Which works great!!

What i want to then do is...

Count the number of cells in column C, (but i'm not sure how to change
the code to do this), and name the Subroutine as RowCCount()

Also

I want to count the number of Empty cells in columm A and name the
Subroutine it Sub EmptyCellCount()

Many thanks








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
Help with changing code Steve Excel Discussion (Misc queries) 3 March 2nd 09 04:03 PM
changing zip code to number John K Excel Discussion (Misc queries) 3 November 21st 08 10:42 PM
changing format code?? please help!!! laandmc Excel Discussion (Misc queries) 2 September 24th 08 09:58 PM
code for changing font Jack Sons Excel Discussion (Misc queries) 2 November 22nd 05 06:42 PM
Changing code with code Kevin Wickersheim Excel Programming 3 May 4th 04 10:36 PM


All times are GMT +1. The time now is 07:04 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"