Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default 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





.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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
What do I do wrong [Excuses pushing the wrong key combination earlier] Vsn Excel Programming 7 November 8th 09 09:12 PM
what is the wrong? rajaiy Excel Worksheet Functions 0 July 27th 09 11:45 AM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
Any wrong with this? Jo[_2_] Excel Discussion (Misc queries) 1 August 2nd 07 09:48 PM
What is wrong?? willroy[_2_] Excel Programming 1 December 12th 03 01:33 PM


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