Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Checkbox detection in macro

The shape variable "cantillation"

In your code it's a String variable

cbxValue = ActiveSheet.Shapes(Application.Caller).ControlForm at.Value
or
cbxValue = ActiveSheet.CheckBoxes(Application.Caller).Value

Adapt one of the above.

It might be worth using different macros for different potential caller
types

Regards,
Peter T

"Marvin" wrote in message
...
The shape variable "cantillation" does not get detected in the "IF"

statement
using xlON and always fails the first test. If I use the actual shape name

it
works fine. Anyone have another idea?

Sub ClearBox()
'
' ClearBox Macro
' Macro recorded 1/16/2007 by Marvin
'
Select Case TypeName(Application.Caller)
Case "Range"
Cantillation = Application.Caller.Address
Case "String"
Cantillation = Application.Caller
Case "Error"
Cantillation = "Error"
Case Else
Cantillation = "unknown"
End Select
MsgBox "caller = " & Cantillation
If [Cantillation] = xlOn Then
ActiveSheet.Shapes(Cantillation).Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13
Else
ActiveSheet.Shapes(Cantillation).Select
Selection.ShapeRange.Fill.Visible = msoFalse
End If
Range("A1").Select
End Sub



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
Checkbox Macro [email protected] Excel Discussion (Misc queries) 3 November 5th 07 07:11 PM
SQL detection brucelim80[_2_] Excel Programming 3 March 10th 06 07:37 AM
checkbox macro Dajana Excel Discussion (Misc queries) 1 November 28th 05 05:22 PM
Detection of Macro Code Chris Gorham Excel Programming 8 September 26th 05 06:43 PM
add-in detection romes1 Excel Programming 2 November 2nd 04 11:59 PM


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

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

About Us

"It's about Microsoft Excel"