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: 1
Default Next Without For


Why am I having problems with the following code below.....

Basically I get the "Next witout For" Compile error when running the
code. Understand what its sayin, but by placing the "Next iRange"
outside the If statement kinda defeats the object of what I want to
do....!

Any Ideas????



For iRange = 1 To iRowNo 'set a loop of rows to cyclce down

strUsrID = ActiveWorkbook.Sheets("Administrators").Cells(iRan ge,
1).Text

For iRange = 1 To iRowNo 'set a loop of rows to cyclce down


If strUsrID = iUsrId Then

Load FrmAdmin
FrmAdmin.Show
Unload FrmNavigation

Else

Next iRange 'WONT WORK, ERROR = "Next Without For"

MsgBox "You are not an authorised Administrator of the System",
vbInformation, "Information" 'and display message

End If


--
gillettos
------------------------------------------------------------------------
gillettos's Profile: http://www.thecodecage.com/forumz/member.php?u=2090
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=207715

http://www.thecodecage.com/forumz


--- news://freenews.netfront.net/ - complaints: ---
 
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



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