PC Review


Reply
Thread Tools Rate Thread

Creation and property manipulation of Control Checkbox using VB

 
 
BRG
Guest
Posts: n/a
 
      1st Aug 2008
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 With Quote
 
 
 
 
Jim Thomlinson
Guest
Posts: n/a
 
      1st Aug 2008
Here is some quick and dirty code to get you started...

Dim ctl As OLEObject

Set ctl = activesheet.OLEObjects.Add(ClassType:="Forms.CheckBox.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 With Quote
 
BRG
Guest
Posts: n/a
 
      5th Aug 2008
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.CheckBox.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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Creation/Manipulation Programmatically in .NET Javed Microsoft Excel Programming 1 31st Mar 2009 07:57 AM
Enable Property of Multipage Control Pages = CheckBox.Value RyanH Microsoft Excel Programming 2 13th May 2008 02:10 PM
how to disable checkbox 'Enable remote control' in the remote control tab in a user property panel lolo Microsoft Dot NET Framework 0 31st Aug 2006 09:40 AM
enable property of checkbox control vikram Microsoft ASP .NET 1 13th Apr 2005 04:44 PM
DateTimePicker Control - Setting CheckBox property to be empty on form load Patrick Gibbons Microsoft Access Forms 0 20th Jan 2004 11:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:55 PM.