Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Visual Basic Code

Hi
I am currently working on a project to transfer application forms to a spread sheet, so far i have been able to add all data, but i am looking for a piece of program that will allow me to use a group of radio boxes (option boxes) to output a number rather than having the same number of cells and true only apearing in one of them

thank you

Robert Couchman
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Visual Basic Code

Robert,

This adds 5 option buttons

For i = 1 To 5
With ActiveSheet.OLEObjects
Set oCtl = .Add(ClassType:="Forms.OptionButton.1", _
Link:=False, _
DisplayAsIcon:=False, _
Left:=500, _
Top:=60 * i, _
Width:=200, _
Height:=32)
oCtl.Object.Caption = "Option " & CStr(i)
End With
Next i


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert Couchman" wrote in
message ...
Hi,
I am currently working on a project to transfer application forms to a

spread sheet, so far i have been able to add all data, but i am looking for
a piece of program that will allow me to use a group of radio boxes (option
boxes) to output a number rather than having the same number of cells and
true only apearing in one of them.

thank you,

Robert Couchman



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Visual Basic Code

Assuming optionbuttons are in a userform you could do something like this.
(don't tie any of the buttons to a cell)
i = 0
for each ct in me.Controls
if typeof ct is MSForms.OptionButton then
i = i + 1
if ct.Value then
Range("Whatever").Value = i
exist for
end if
end if
Next

--
Regards,
Tom Ogilvy


"Robert Couchman" wrote in
message ...
Hi,
I am currently working on a project to transfer application forms to a

spread sheet, so far i have been able to add all data, but i am looking for
a piece of program that will allow me to use a group of radio boxes (option
boxes) to output a number rather than having the same number of cells and
true only apearing in one of them.

thank you,

Robert Couchman



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
Visual Basic Code hidden Dennis Excel Discussion (Misc queries) 2 October 22nd 08 07:14 AM
repeating code in visual basic tobypitblado Excel Discussion (Misc queries) 4 September 17th 08 11:55 AM
Visual Basic code Pickle Excel Discussion (Misc queries) 1 September 4th 08 03:35 PM
I need a visual basic code....please Rhonda Excel Discussion (Misc queries) 1 March 5th 07 01:18 PM
Visual Basic Code in Excel Solver[_2_] Excel Programming 0 January 20th 04 07:55 PM


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