ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   send keys (https://www.excelbanter.com/excel-programming/294663-send-keys.html)

ksnapp[_52_]

send keys
 
hi,

is there a way send keys can check a check box?

I can select the line next to it but i can't figure a way to get th
effect of clicking on it

regards
kevi

--
Message posted from http://www.ExcelForum.com


Vasant Nanavati

send keys
 
Using SendKeys is generally a very bad idea, unless no other alternative is
available. Usually there are far better ways of accomplishing your
objectives.

--

Vasant

"ksnapp " wrote in message
...
hi,

is there a way send keys can check a check box?

I can select the line next to it but i can't figure a way to get the
effect of clicking on it

regards
kevin


---
Message posted from http://www.ExcelForum.com/




Greg Wilson[_4_]

send keys
 
Assuming a worksheet based check box from the Forms tool
bar and you want to run a macro only when it's checked:

Sub ToggleCheckBox()
With Sheets("Sheet1").Shapes("Check Box 1").ControlFormat
If .Value = 1 Then
.Value = -4146
Else
.Value = 1
Call CheckBoxIsChecked
End If
End With
End Sub

Sub CheckBoxIsChecked()
MsgBox "Hello"
End Sub

Works for me.

Regards,
Greg

-----Original Message-----
hi,

is there a way send keys can check a check box?

I can select the line next to it but i can't figure a way

to get the
effect of clicking on it

regards
kevin


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 08:41 AM.

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