Where am I going wrong ?

J

Jim

I'm trying to use SetFocus but not suceeding
Please would you indicate the error in the following code

For c = StartColNo To EndColNo - 1
If Sheets("Template").Cells(RowNo, c) > 0 Then
MsgBox "WARNING - This Room is not available"
UserForm1.cb_Rooms.SetFocus
Exit Sub
End If
Next c

I'm using Windows 7 and Excel 2007

Regards & TIA
 
J

Jackpot

Try the below

For c = StartColNo To EndColNo - 1
If Sheets("Template").Cells(1, c) > 0 Then
MsgBox "WARNING - This Room is not available"
UserForm1.Show
UserForm1.cb_Rooms.SetFocus
Exit Sub
End If
Next c
 
D

Dave Peterson

Where is your code located?

I don't think you gave enough information to get help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top