Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
brg brg is offline
external usenet poster
 
Posts: 15
Default Creation and property manipulation of Control Checkbox using VB

I have created a tool that allows the user to import specific data from a
related spreadsheet. This data gets pasted into the next open row in a table
in the open spreadsheet.

I'm looking for a method to create a new control checkbox in the rightmost
column whenever a new row is created in the table. I'd also like to
manipulate the properties of the button, for instance link the button to the
cell beneath, set the size of the button to be the same as the linked cell,
change the button's colour and caption etc. Any hints would be greatly
appreciated
--
BRG
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Creation and property manipulation of Control Checkbox using VB

Here is some quick and dirty code to get you started...

Dim ctl As OLEObject

Set ctl = activesheet.OLEObjects.Add(ClassType:="Forms.Check Box.1")

ctl.TopLeftCell = ActiveCell
ctl.Object.Caption = "Tada"
--
HTH...

Jim Thomlinson


"BRG" wrote:

I have created a tool that allows the user to import specific data from a
related spreadsheet. This data gets pasted into the next open row in a table
in the open spreadsheet.

I'm looking for a method to create a new control checkbox in the rightmost
column whenever a new row is created in the table. I'd also like to
manipulate the properties of the button, for instance link the button to the
cell beneath, set the size of the button to be the same as the linked cell,
change the button's colour and caption etc. Any hints would be greatly
appreciated
--
BRG

  #3   Report Post  
Posted to microsoft.public.excel.programming
brg brg is offline
external usenet poster
 
Posts: 15
Default Creation and property manipulation of Control Checkbox using V

Hey Jim,

Thanks for the tip, that was what I was looking for. Just a quick question
out of curiosity, the checkboxes that are created with this code are
different than the checkboxes that I create using the controls toolbar, for
instance I can't right click on these checkboxes to access their properties.
In the code you sent the class type is "Forms.CheckBox.1". Is this actually
equivalent to a Forms checkbox? And if so how do you create a "Controls"
checkbox?

Thanks,
--
BRG


"Jim Thomlinson" wrote:

Here is some quick and dirty code to get you started...

Dim ctl As OLEObject

Set ctl = activesheet.OLEObjects.Add(ClassType:="Forms.Check Box.1")

ctl.TopLeftCell = ActiveCell
ctl.Object.Caption = "Tada"
--
HTH...

Jim Thomlinson


"BRG" wrote:

I have created a tool that allows the user to import specific data from a
related spreadsheet. This data gets pasted into the next open row in a table
in the open spreadsheet.

I'm looking for a method to create a new control checkbox in the rightmost
column whenever a new row is created in the table. I'd also like to
manipulate the properties of the button, for instance link the button to the
cell beneath, set the size of the button to be the same as the linked cell,
change the button's colour and caption etc. Any hints would be greatly
appreciated
--
BRG

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
Enable Property of Multipage Control Pages = CheckBox.Value RyanH Excel Programming 2 May 13th 08 02:10 PM
checkbox property ranswert Excel Programming 1 January 28th 08 08:18 PM
.onaction property for controls checkbox excel_stuck via OfficeKB.com Excel Programming 7 August 14th 06 01:51 PM
Programatically control picture property of Image control Brassman[_5_] Excel Programming 5 May 24th 05 09:32 PM
Conditional Checkbox Creation on a UserForm Todd Huttenstine[_2_] Excel Programming 1 November 21st 03 03:38 PM


All times are GMT +1. The time now is 04:48 AM.

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"