ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User form OK command automate (https://www.excelbanter.com/excel-programming/358982-user-form-ok-command-automate.html)

reachthepalace[_2_]

User form OK command automate
 

Is there some line I can include in a form that does the 'click' o
click OK for me. I have a form that processes some data, and since
know the data well, I just want the forms to be processed (about 500 o
them) on a batch mode. The way it is set up now, I have to click ok (o
enter from keyboard), each time.

When the form is called the tab focus and tab index are set to the O
command button. I need some line to say that it is clicked.

More on why I need this, this way....

I am tweaking a form created by someone before me to input certai
range of data. The form has a bunch of code that check for types o
data and prompts for user to select the range. Upon selecting the rang
and click 'OK', it formats the data, and sends some key information t
the calling sub. All this happens within the user form. I don't inten
to change the form, but I'm having the task to redo some work (abou
500 inputs). So if I can set my machine to do this on a batch mode
will save me some time.

Thanks
D

--
reachthepalac
-----------------------------------------------------------------------
reachthepalace's Profile: http://www.excelforum.com/member.php...fo&userid=3172
View this thread: http://www.excelforum.com/showthread.php?threadid=53323


Bob Phillips[_6_]

User form OK command automate
 
Application.SendKeys "{ENTER}"

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"reachthepalace"
<reachthepalace.26cecy_1145166301.8707@excelforu m-nospam.com wrote in
message news:reachthepalace.26cecy_1145166301.8707@excelfo rum-nospam.com...

Is there some line I can include in a form that does the 'click' or
click OK for me. I have a form that processes some data, and since i
know the data well, I just want the forms to be processed (about 500 of
them) on a batch mode. The way it is set up now, I have to click ok (or
enter from keyboard), each time.

When the form is called the tab focus and tab index are set to the OK
command button. I need some line to say that it is clicked.

More on why I need this, this way....

I am tweaking a form created by someone before me to input certain
range of data. The form has a bunch of code that check for types of
data and prompts for user to select the range. Upon selecting the range
and click 'OK', it formats the data, and sends some key information to
the calling sub. All this happens within the user form. I don't intent
to change the form, but I'm having the task to redo some work (about
500 inputs). So if I can set my machine to do this on a batch mode,
will save me some time.

Thanks
DR


--
reachthepalace
------------------------------------------------------------------------
reachthepalace's Profile:

http://www.excelforum.com/member.php...o&userid=31729
View this thread: http://www.excelforum.com/showthread...hreadid=533236




reachthepalace[_3_]

User form OK command automate
 

Clarification - Where does this command Application.sendkeys("{Enter}"
go?
In the sub, where the form is called or in the form itself. I've
attached parts of the code here

Form is called:

'Display Store Data userform
Dim ufStoreData As frmStoreData
Set ufStoreData = New frmStoreData
__Application.SendKeys_(\"{ENTER}\")_
With ufStoreData
..DataType = TYPE_RTS
..FormatMe
..Show

'If cancel button selected end routine
'If mvSDContinue = False Then Exit Sub
If .lblCanceled = True Then
Unload ufStoreData
Set ufStoreData = Nothing
Exit Sub
End If
'If cancel button not chosen, continue
Dim strSourceRangeAddress As String
If .optAlways.Value = True Then
rIPLAN = 0
ElseIf .optNew.Value = True Then
rIPLAN = 1
Else
rIPLAN = 2
End If
If .optYes.Value = True Then
rLABEL = CLng(True)
Else
rLABEL = CLng(False)
End If
strSourceRangeAddress = .refData.Text
End With
Unload ufStoreData
Set ufStoreData = Nothing


--
reachthepalace
------------------------------------------------------------------------
reachthepalace's Profile: http://www.excelforum.com/member.php...o&userid=31729
View this thread: http://www.excelforum.com/showthread...hreadid=533236



All times are GMT +1. The time now is 05:42 PM.

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