View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default XL2002 - Worksheet_Activate Question...

I didn't try going through the shapes collection.

I'd just use:

Private Sub Worksheet_Activate()
dim i as long
For i = 1 To 8
me.checkboxes("cbx" & i).caption = me.Range("myYear").value
Next i
End Sub

myYear is a single cell range on the same sheet, right?



Trevor Williams wrote:

The following code works when run from a Module, but not when it's run from the
Worksheet_Activate area - can you tell me why?

(the Shapes are Check Boxes from the Forms toolbar)

Private Sub Worksheet_Activate()
For i = 1 To 8
ActiveSheet.Shapes("cbx" & i).OLEFormat.Object.Text = Range("myYear")
Next
End Sub

Thanks in advance

Trevor Williams


--

Dave Peterson