View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Working with Visual Basic Check bo contrls

Checkboxes have a LINKEDCELL property. when this property is used it will
change the value of the cell from TRUE to FALSE. the linkedcell will also
cause a worksheet change event to occur. You can write a worksheet chagge
function to highlight the entire row.


sub worksheet_change(ByRef Target as Range)

'Column E will contained linked cell for the check boxes
if Target.Column = 5 then
if Target = True
Rows(target.row).interior.colorindex = 6
else
Rows(target.row).interior.colorindex = 3
end if
end if
end sub
"Nayan" wrote:

Hi there,

(environment Excel 2003: Windows XP professional)

I have a list of Checkbox controls (OLEObjects) in one of the column in
workbook1.sheet1.

From another addin (say Admin.xla) I want to cotrol click event of a check
box that is in workbook1.sheet1.

Objective is to change (from Admin.xla) the background color of the row (in
workbook1.sheet1) for which the check box is seleted ( in workbook1.sheet1).

I am adding these controls at run time when the workbook1.sheet1 is opened.
And the number of check boxes added could be from 10 to 500 as per the
records in the sheet.

Check boxes are named at run time. for eg Checkbox added in row 5 and Col 6
is named as R5C6 programmatically.

Any idea ??????

Thanks in advance.

Nayan