Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Programmatically set checkbox values on worsheet

How about

ShtDest.OLEObjects("CheckBox1").Object.Value _
= CBool(shtGap.Cells(GapPointer, 16).Value = True)

Remember, it's looking for true/false (if it's two state)

Dale Fye wrote:

I have a worksheet I am using as a report for data that is stored in another
worksheet in my workbook.

I have some checkboxes that I added to the worksheet using the Control
Toolbox, all of which are named. How can I set the values (checked or
unchecked) of these checkboxes based on the values in the other worksheet?
For other cells in the report, I am using:

shtDest.Cells(10, 2) = shtGap.Cells(GapPointer, 16)

I have tried:

shtDest.OLEObjects("chk_Doctrine").Checked = shtGap.Cells(GapPointer, 3)

but this generates an "Object doesn't support this property or method" error.

While searching for an answer, I've come to realize that there are two types
of control toolboxes (Control and Form) and I selected the Control Toolbox.
If I need to change that to the Forms toolbox, now would be a good time to
let me know.

Thanks for your feedback.

Happy Thanksgiving!

--
Don''t forget to rate the post if it was helpful!

Email address is not valid.
Please reply to newsgroup only.


--

Dave Peterson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Programmatically set checkbox values on worsheet

Thanks, Dave.

Exactly what I was looking for.

Dale
--
Email address is not valid.
Please reply to newsgroup only.


"Dave Peterson" wrote:

How about

ShtDest.OLEObjects("CheckBox1").Object.Value _
= CBool(shtGap.Cells(GapPointer, 16).Value = True)

Remember, it's looking for true/false (if it's two state)

Dale Fye wrote:

I have a worksheet I am using as a report for data that is stored in another
worksheet in my workbook.

I have some checkboxes that I added to the worksheet using the Control
Toolbox, all of which are named. How can I set the values (checked or
unchecked) of these checkboxes based on the values in the other worksheet?
For other cells in the report, I am using:

shtDest.Cells(10, 2) = shtGap.Cells(GapPointer, 16)

I have tried:

shtDest.OLEObjects("chk_Doctrine").Checked = shtGap.Cells(GapPointer, 3)

but this generates an "Object doesn't support this property or method" error.

While searching for an answer, I've come to realize that there are two types
of control toolboxes (Control and Form) and I selected the Control Toolbox.
If I need to change that to the Forms toolbox, now would be a good time to
let me know.

Thanks for your feedback.

Happy Thanksgiving!

--
Don''t forget to rate the post if it was helpful!

Email address is not valid.
Please reply to newsgroup only.


--

Dave Peterson

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
Can I use a worsheet name (filename), and a range name as values? RobertoB Excel Discussion (Misc queries) 2 October 28th 08 09:28 PM
Using Checkbox Values D Zandveld Excel Programming 2 March 5th 07 09:04 AM
label x-axis values programmatically [email protected] Charts and Charting in Excel 1 September 5th 06 03:04 AM
Programmatically reading data field values from PivotTable Enrico Campidoglio[_2_] Excel Programming 2 July 13th 05 12:32 PM
Programmatically set Excel 97 Control Toobar Checkbox object & container name Matt Jensen Excel Programming 19 January 10th 05 07:46 PM


All times are GMT +1. The time now is 03:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"