LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Do Loop doesn't process

I am using the top sub to control detection of the first row that has a
nonnull value in ColG. If I select any cell on the sheet other than G2
and then run the sub, a message box appears as expected and G2 is
highlighted. Using F8 fxn key, each subsequent row is highlighted
through "Do While Not IsEmpty(ActiveCell)", but then jumps down to End
Sub. Neither "Range" or the value for Count appears in the intermediate
window. What am I doing wrong (I have copied this from other
applications I have developed which work fine)?

Thanks

Sub Control()

Range("G2").Select
MsgBox ActiveCell.Value


Count = 0
'Debug.Print Count
CountRows

End Sub
__________________________________


Option Explicit
Public Count As Integer

Public Sub CountRows()
Do While Not IsEmpty(ActiveCell)
Debug.Print "Range"

ActiveCell.Offset(1, 0).Select
Count = Count + 1
Debug.Print Count
Loop

End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
way to automate this process rodchar Excel Discussion (Misc queries) 4 June 26th 09 06:52 PM
If/then Process? Zane B Stein Excel Discussion (Misc queries) 1 December 20th 05 03:27 PM
Process Theads rudolpsh[_2_] Excel Programming 2 January 23rd 04 09:22 AM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM
step into process Tom Ogilvy Excel Programming 0 August 16th 03 12:46 PM


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