From: Jim on 3 Jun 2010 15:55 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
From: Jackpot on 4 Jun 2010 01:56 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 > > > > > > . >
From: Dave Peterson on 4 Jun 2010 07:19 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
|
Pages: 1 Prev: Separate code from workbook?! Next: using ADO from Excel 2007 |