View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Newbie : question on VBA and checkboxes

Hi Daniel,

Couple of sites to check out for information. Don't really know if you will
find what you want on check boxes but I have found them good for other stuff:-

http://www.cpearson.com/Excel/Search.htm

http://www.mrexcel.com/

In answer to your other question: Here are two sample code examples which
might help:-

Note: I don't know why Object is required after OLEObjects to obtain the
value when it is not required for the Name. (I adapted info from a reply to
me from Chip Pearson on another issue with Combo boxes.)


Option 1:
Sub Macro1()
Dim i As Integer

For i = 1 To ActiveSheet.OLEObjects.Count
If ActiveSheet.OLEObjects(i).Object = True Then
MsgBox ActiveSheet.OLEObjects(i).Name & Chr(13) & _
ActiveSheet.OLEObjects(i).Object.Value
Else
MsgBox ActiveSheet.OLEObjects(i).Name & Chr(13) & _
ActiveSheet.OLEObjects(i).Object.Value
End If
Next i

End Sub



Option 2:
Sub Macro2()
Dim i As Integer

With ActiveSheet
For i = 1 To .OLEObjects.Count
If .OLEObjects(i).Object = True Then
MsgBox .OLEObjects(i).Name & Chr(13) & _
.OLEObjects(i).Object.Value
Else
MsgBox .OLEObjects(i).Name & Chr(13) & _
.OLEObjects(i).Object.Value
End If
Next i
End With

End Sub


Regards,

OssieMac