Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change while loop from count to formula


I would like to adapt the following code to use a formula to calculat
the value of 53, like the counter is doing below. For eac
"Currentcolumn" there is a countIf formula in row 8 when that formul
reaches 53 I want to stop adding the value "New" to each column.

What it does now is check the variable totalrow once and if it is les
than 53 it adds the value upto 53 and higher. I want to stop whe
totalrow(8) = 53

Thanks



Dim CurrentColumn As Integer, CurrentRow As Long, totalrow As Long
Count As Byte
With ActiveSheet

For CurrentColumn = 7 To 103
CurrentRow = 11
totalrow = 8
Count = 0
While Count < 53 And CurrentRow <= 298 And .cells(totalrow
CurrentColumn).Value < 53 If .cells(CurrentRow, CurrentColumn).Value
"." Then
.cells(CurrentRow, CurrentColumn).Value = "New"
Count = Count + 1 + totalrow
End If
CurrentRow = CurrentRow + 1
Wend
Next CurrentColumn
End Wit

--
hotherp
-----------------------------------------------------------------------
hotherps's Profile: http://www.excelforum.com/member.php...nfo&userid=505
View this thread: http://www.excelforum.com/showthread.php?threadid=31371

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change while loop from count to formula

isn't that what this line is doing?

.cells(totalrow,CurrentColumn).Value < 53

--
Regards,
Tom Ogilvy


"hotherps" wrote in message
...

I would like to adapt the following code to use a formula to calculate
the value of 53, like the counter is doing below. For each
"Currentcolumn" there is a countIf formula in row 8 when that formula
reaches 53 I want to stop adding the value "New" to each column.

What it does now is check the variable totalrow once and if it is less
than 53 it adds the value upto 53 and higher. I want to stop when
totalrow(8) = 53

Thanks



Dim CurrentColumn As Integer, CurrentRow As Long, totalrow As Long,
Count As Byte
With ActiveSheet

For CurrentColumn = 7 To 103
CurrentRow = 11
totalrow = 8
Count = 0
While Count < 53 And CurrentRow <= 298 And .cells(totalrow,
CurrentColumn).Value < 53 If .cells(CurrentRow, CurrentColumn).Value =
"." Then
cells(CurrentRow, CurrentColumn).Value = "New"
Count = Count + 1 + totalrow
End If
CurrentRow = CurrentRow + 1
Wend
Next CurrentColumn
End With


--
hotherps
------------------------------------------------------------------------
hotherps's Profile:

http://www.excelforum.com/member.php...fo&userid=5055
View this thread: http://www.excelforum.com/showthread...hreadid=313719



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 rownumbers in loop TUNGANA KURMA RAJU Excel Discussion (Misc queries) 9 October 3rd 05 09:29 AM
loop count TUNGANA KURMA RAJU Excel Discussion (Misc queries) 2 October 1st 05 04:54 AM
How can I loop to find the grouped shapes count David Cuthill Excel Programming 3 January 26th 04 08:22 PM
End loop macro with count Jason C. Excel Programming 1 July 16th 03 01:21 PM


All times are GMT +1. The time now is 09:19 AM.

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"