gillettos;739962 Wrote:
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????
VBA Code:
--------------------
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
--------------------
You have repeated this line
VBA Code:
--------------------
For iRange = 1 To iRowNo 'set a loop of rows to cyclce down
--------------------
but you only have one NEXT so either delete the line or add a NEXT.
--
Simon Lloyd
Regards,
Simon Lloyd
'Microsoft Office Help' (
http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile:
http://www.thecodecage.com/forumz/member.php?u=1
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=207715
http://www.thecodecage.com/forumz
---
news://freenews.netfront.net/ - complaints:
---