Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50151

Excel checkbox macros

$
0
0
I posted yesterday about getting a checkbox macro that would set the linked cell to another page and got the following code:
PHP Code:

Sub addCBX()
Dim myCBX As CheckBox
Dim myCell 
As Range
    With ActiveSheet
       
.CheckBoxes.Delete
       
For Each myCell In ActiveSheet.Range("D8:D67,E8:E67,F8:F67,G8:G67")
            
With myCell
               Set myCBX 
= .Parent.CheckBoxes.Add _
                               
(Top:=.TopWidth:=.Width_
                               Left
:=.LeftHeight:=.Height)
               
With myCBX
                   
.LinkedCell "A!" myCell.Address
                   
.Caption ""
                 
End With
            End With
       Next myCell
   End With
End Sub 

This code works for one worksheet, but how can I make it work for another worksheet except this time with an offset of four on the linked cell?
Thanks

Viewing all articles
Browse latest Browse all 50151

Trending Articles