LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default VBA Variable as userform

I need some help:



I am trying to declare a varible of type userform so I can pass it as a
paramater such as :



Public ufrmForm As UserForm



Sub ValidEntry(i)
For Each ctlFormControl In frmNewOrder.Controls
If ctlFormControl.TabIndex = i Then
Worksheets("WorkingArea").Activate
Range("C2") = ctlFormControl
Range("E2").Select
If ActiveCell.Value = "not valid" Then
intError = MsgBox(strMsg, vbOKOnly, "Error")
Call TextSelect(frmNewOrder, i)
End If
Exit For
End If
Next ctlFormControl
End Sub



Public Sub TextSelect(ufrmForm, i)
For Each ctlFormControl In ufrmForm.Controls
If ctlFormControl.TabIndex = i Then
ctlFormControl.SelStart = 0
intTextLength = Len(ctlFormControl.Text)
ctlFormControl.SelLength = intTextLength
Exit For
End If
Next ctlFormControl
End Sub



not working real well...............any ideas?



thanks and have a great day,

Brian

 
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
Userform and variable Jeff Excel Discussion (Misc queries) 1 March 16th 07 03:14 PM
Variable ComboBox on Userform DHallam Excel Programming 2 July 19th 05 12:20 PM
Qn: Define a variable in Initialize for Userform Michael Vaughan Excel Programming 4 August 21st 04 12:10 PM
userform variable as global crew3407[_6_] Excel Programming 8 May 6th 04 04:38 PM
Passing a value to a variable from Userform Neal Steiner Excel Programming 1 July 18th 03 09:12 PM


All times are GMT +1. The time now is 09:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"