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

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



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

.

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
Send keys with user input sunspot27 Excel Worksheet Functions 1 August 9th 09 10:20 PM
Send keys from command button sunspot27 Excel Worksheet Functions 0 July 28th 09 12:10 PM
Send Keys Akshay Bakhai Excel Programming 1 August 22nd 03 03:33 PM
Send Keys [email protected] Excel Programming 0 August 21st 03 08:13 PM
Send Keys pancho[_14_] Excel Programming 1 August 21st 03 07:54 PM


All times are GMT +1. The time now is 06:56 PM.

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"