Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Executing a subroutine from within a loop

This should work but it does not. The macro just steps over the
subroutine
message without executing it. What am I missing?

-VBA 2003

dim ii as integer

For ii=1 to 3
message
next ii

Public Sub Message()
MsgBox "Time to take a break!"
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Executing a subroutine from within a loop

Hi Jeff,
it worked for me. Of course I had to copy the loop into a blank Sub
that I've called MessageRunner

Public Sub MessageRunner()
Dim ii As Integer

For ii = 1 To 3
Message
Next ii
End Sub

Public Sub Message()
MsgBox "Time to take a break!"
End Sub

Ken Johnson

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
Call a subroutine using variable subroutine name dhstein Excel Discussion (Misc queries) 3 July 26th 09 08:28 PM
SUBROUTINE HELP biker man Excel Discussion (Misc queries) 1 July 28th 07 04:06 PM
Calling a subroutine in a loop Jeff@DE Excel Programming 1 January 9th 06 09:56 AM
end subroutine melric Excel Programming 3 March 31st 05 12:32 AM
Calling a function from a subroutine loop Dan Excel Programming 1 November 27th 04 01:28 AM


All times are GMT +1. The time now is 11:47 PM.

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"