ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Where am I going wrong ? (https://www.excelbanter.com/excel-programming/443072-where-am-i-going-wrong.html)

Jim[_74_]

Where am I going wrong ?
 
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






Jackpot

Where am I going wrong ?
 
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

"Jim" wrote:

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





.


Dave Peterson

Where am I going wrong ?
 
Where is your code located?

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

Jim wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 01:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com