Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default need help with macro (checkboxes)

I would like to create automatically a checkbox per row but also if
the checkbox is selected I want to hide columns J to K, I got this
code but I don't know how to change it to put the condition about
hiding the columns.
could anybody help me...

this is the code :

Sub add_checkbox()
On Error Resume Next
Dim c As Range, myRange As Range
Set myRange = Selection
For Each c In myRange.Cells
ActiveSheet.CheckBoxes.Add(c.Left, c.Top, c.Width,
c.Height).Select
With Selection
.LinkedCell = c.Address
.Characters.Text = ""
.Name = c.Address
End With

c.Select
With Selection
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression,
Formula1:="=" & c.Address & "=TRUE"
.FormatConditions(1).Font.ColorIndex = 6 'change
for other color when ticked
.FormatConditions(1).Interior.ColorIndex = 6
'change for other color when ticked
.Font.ColorIndex = 2 'cell background color =
White
'I think here should be the hiding option but i
don't know how to write it
End With


Next
myRange.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
Checkboxes disappear after macro is run Jonas Excel Programming 7 May 27th 09 09:27 PM
Macro to clear checkboxes Guy[_2_] Excel Worksheet Functions 5 January 2nd 09 08:39 PM
Multiple checkboxes, one macro? pkohler[_10_] Excel Programming 6 July 1st 05 06:54 PM
Checkboxes to spreadsheet using a looping macro Eddie[_5_] Excel Programming 0 September 8th 04 11:04 AM
Multiple checkboxes 1 macro George J Excel Programming 6 October 15th 03 04:50 PM


All times are GMT +1. The time now is 07:25 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"