Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default A quick way to edit the formula in check boxes

Hi there,
I have got a massive number of check boxes which all need to be linked to a
cell. I know you can do this by clicking on each box individually, but I
wondered if anyone knows a quick way of editing the formulas behind the boxes
en masse.
If it were an ordinary formula, find and replace would do the trick but this
doesn't work for check boxes.
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default A quick way to edit the formula in check boxes

It depends on the type of checkbox--are they from the Forms toolbar or from the
Control toolbox toolbar?

And where do you want the linked cell?

I used the cell that held the checkbox as the linked cell in both these
routines:

Option Explicit
Sub testme01()
Dim CBX As CheckBox
For Each CBX In ActiveSheet.CheckBoxes
CBX.LinkedCell = CBX.TopLeftCell.Address(external:=True)
'hide the value??
CBX.TopLeftCell.NumberFormat = ";;;"
Next CBX
End Sub

Sub testme02()
Dim OLEObj As OLEObject
For Each OLEObj In ActiveSheet.OLEObjects
If TypeOf OLEObj.Object Is MSForms.CheckBox Then
OLEObj.LinkedCell = OLEObj.TopLeftCell.Address(external:=True)
OLEObj.TopLeftCell.NumberFormat = ";;;"
End If
Next OLEObj
End Sub

The first is for checkboxes from the Forms toolbar. The second is for
checkboxes from the Control Toolbox Toolbar.

Plum wrote:

Hi there,
I have got a massive number of check boxes which all need to be linked to a
cell. I know you can do this by clicking on each box individually, but I
wondered if anyone knows a quick way of editing the formulas behind the boxes
en masse.
If it were an ordinary formula, find and replace would do the trick but this
doesn't work for check boxes.
Thanks.


--

Dave Peterson
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
Making a Formula Contingent on Check Boxes [email protected] Excel Worksheet Functions 5 July 3rd 07 02:51 PM
Formula for using check boxes Hell-fire New Users to Excel 1 June 14th 07 09:34 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
How do i create a value for check boxes or option boxes Tim wr Excel Discussion (Misc queries) 1 February 9th 06 10:29 PM
Creating Formula using check boxes Anthony Slater Excel Discussion (Misc queries) 3 January 4th 05 03:03 PM


All times are GMT +1. The time now is 11:29 AM.

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"