Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

expanding a range in VBA

Status
Not open for further replies.

Davidprince

Programmer
Jul 1, 2003
52
AU
Ladies and Gentlemen
I am completing a program in VBA and am wondering if there is a way to solve a problem within the code. This section counts up the number of occurrences of a letter occurring in a range. The problem is the range expands one cell at a time until the count for any letter is two more than any other letter. The count variables are reset and the process starts over. An example may clarify things:

Letter Count
Sequence
A 1
C 1
D 1
A 2



Report result A occurred 2 times

The variables A,B,C and D are reset. As mentioned in the Subject I think the issue is how to expand the range as you count the occurrences.
Any suggestions?
Thanks
David - out of practise programmer
 



HI,

You do not need VBA.

Use the COUNTIF function on the sheet.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 


for instance
[tt]
=countif(A:A,"A")
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top