Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default variable counter/total

I'm trying to count entries and amounts in 25 columns,
and want to pace the results in a "tot" work area: tot1 -
tot25. How can I use the counter as a variable?
j = 1
i = 1
Do Until j = 25
Do Until Cells(i, 2) = ""
"tot" & cells(j) = "tot" & cells(j) + 1
If Cells(i, 2) 119 Then
pt1 = pt1 + 2
Else
If Cells(i, 2) 79 Then
pt1 = pt1 + 1
Else
pt1 = pt1 + 0
End If
pt1 = pt1 + 0
End If
i = i + 1
Loop
j = j + 1
Loop

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default variable counter/total

not sure if I read this properly, but would it be more
efficent to use sumif's and countif's (ie. the worksheet
functions)
-----Original Message-----
I'm trying to count entries and amounts in 25 columns,
and want to pace the results in a "tot" work area: tot1 -
tot25. How can I use the counter as a variable?
j = 1
i = 1
Do Until j = 25
Do Until Cells(i, 2) = ""
"tot" & cells(j) = "tot" & cells(j) + 1
If Cells(i, 2) 119 Then
pt1 = pt1 + 2
Else
If Cells(i, 2) 79 Then
pt1 = pt1 + 1
Else
pt1 = pt1 + 0
End If
pt1 = pt1 + 0
End If
i = i + 1
Loop
j = j + 1
Loop

End Sub
.

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
Counter Mubarak Excel Discussion (Misc queries) 1 December 21st 09 05:34 PM
Day counter poohgld Excel Discussion (Misc queries) 2 October 2nd 08 10:45 AM
Counter variable and a multiplier LenS Excel Discussion (Misc queries) 1 February 23rd 07 11:50 AM
counter Haza Excel Discussion (Misc queries) 2 January 20th 06 08:30 PM
Counter Polina Excel Discussion (Misc queries) 2 May 27th 05 09:52 PM


All times are GMT +1. The time now is 06:33 AM.

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"