LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Create a vbCheckbox from code in vb command button

One more thing, I also need a code that will remove the checkboxes after
a process has been completed.

"KJ MAN" wrote:

After these checkboxes are created, you still must manually program them
correct?
If so, Is there any way that they can be scripted from the code that creates
them?
I need them to be created after a search has been completed and when the
user clicks the ckeckbox, the checkbox will retrieve information from the
adjacent row.

Thanks for eveything chip//

"Chip Pearson" wrote:

The following code should get you started. It creates 11 checkboxes in cells
B10:B20.

Sub AAA()
Dim N As Long
Dim CHK As Excel.CheckBox
Dim WS As Worksheet
Dim R As Range

Set WS = ThisWorkbook.Worksheets("Sheet1")
For N = 10 To 20
Set R = WS.Cells(N, "B")
Set CHK = WS.CheckBoxes.Add(Left:=R.Left, _
Top:=R.Top, _
Width:=R.Width, _
Height:=R.Height)
With CHK
.OnAction = "'" & ThisWorkbook.Name & "'!CheckBoxAction"
End With
Next N
End Sub


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"KJ MAN" wrote in message
...
This one may be for the pro's only.
I have a program button that will return values from another spreadsheet
and return them to a range on another sheet. I need my command button to
also create a vb checkbox or on off radio button beside each entry that it
copies.
Each time the button is pressed the number of returns will be different.
Users need to be able to select certain returned values and omit others
and
then
process another button that will take the info from beside the selected
checkboxes
and copy it to another location.


 
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
Create command button with VBA Les Excel Programming 1 December 10th 07 11:59 AM
Code to Create a Command Button [email protected] Excel Programming 0 September 13th 07 03:37 PM
Wanting to Create A Command Button Command bumper338 Excel Programming 3 May 7th 07 06:53 PM
How to Create a Command Button Jason Excel Discussion (Misc queries) 1 October 12th 05 09:50 PM
Create Command Button from Code Bruce B[_2_] Excel Programming 0 July 14th 03 02:01 PM


All times are GMT +1. The time now is 10:18 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"