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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lotus 123 macro 1

Status
Not open for further replies.

pvsmith

Technical User
Oct 14, 2002
2
CA
I require a lotus 123 macro that will count the number of occurences of letters from a list of names so that I can determine how many letters of each type are in the list.
 
Use @countif(range;criteria)
The criteria is what you are after. Look at the @function Help for some details.
 
Here is a macro:

r
n

\z {select results}
{select-range-relative ;;;1}{delete}
{For r;0;@rows(list)-1;1;doRows}

curLine

doRows {let curLine;@index(list;0;r)}
{For n;0;@length(curLine)-1;1;doLine}

curChar

doLine {let curChar;@mid(curLine;n;1)}
{if @exact(@upper(curChar);@lower(curChar))}{return}
{put results;1;@vlookup(@upper(curChar);results;0);@vlookup(@upper(curChar);results;1)+1}


In order to use this, just create a two-column range on a separate sheet called "results". The numbers column should start out as blank. It will be populated by the macro:

A 121
B 32
C 48
D 48
E 137
F 19
G 30
H 60
I 61
J 2
K 29
L 82
M 53
N 108
O 101
P 19
Q 1
R 107
S 91
T 64
U 34
V 16
W 26
X
Y 28
Z 8


The input of names should be a single column range named "list" on a separate sheet.

I can email the file to you if you wish.
 
Thanks:

If you could email me the file that would be great.

patrick.v.smith@sympatico.ca

Thanks

Pat

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top