LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default check ocontrols within frames within userform

dear gurus -
i'm in waaaay over my head. i THINK i understand this theory...... to
explain:

i have a userform w/a 3-page multipage.
each multipage has (approx.) 4 frames on it
each frame has 3-5 option buttons in it.
the purpose of the userform is to incrementally add "1" to each
evaluation question on the worksheet.

Question 1 (frame name is Q1)
5 (optionbutton name is Q1Opt5)
4 (optionbutton name is Q1Opt4)
3 (name is Q1Opt3)

Question 2 (frame name is Q2)
5 (name is Q2Opt5)
4 (name is Q2Opt4)
3 (name is Q2Opt3)

and so forth. the worksheet ranges correspond:
Set r1 = ws.Range("d8:j13")
Set r2 = ws.Range("d18:j23")
Set r3 = ws.Range("d28:j33")

so, i want to go thru each frame, find the option button that is
selected, find THAT # option button in the corresponding range, find
the correct row, and add 1 to the correct column in the correct row in
the correct range. i'm using iCtr as the numeral for each frame.
this is what i've got so far..............

Dim iCtr As Long
'this is how i can incrementally check each frame
For iCtr = 1 To 13
If TypeOf oControl Is msforms.Frame Then
oControl = "Frame" & iCtr
'now i need to see which option button = true within each frame...
For Each oControl In oControl
If oControl("Q" & iCtr & "Opt1").Value = True Then
sRange = "r" & iCtr
sCaption = oControl("Q" & iCtr & "Opt1").Caption
'the captions of each option button are 1, 2, 3, etc.
Set rFound = myRange.Find(What:=sCaption, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False)
If rFound Is Nothing Then
MsgBox "Caption not found in range"
End If
myRow = rFound.Row
'column i contains the numeric that needs incrementing
Set myRange = ws.Range("i" & myRow)
myRange.Value = myRange.Value + 1
'example: Range("C2") = 26
'myRange("C2").value (26) = 26 + 1
End If
Next oControl
End If

Next iCtr

as i usually do, i suspect this is coded way more difficult than it
needs to be.

any help or suggestions?
thank you!
susan

 
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
How do I subtract time where hh:mm:ss:ff (frames = 30 frames/sec) KJ7 Excel Discussion (Misc queries) 14 December 3rd 16 10:03 AM
Problem loading userform with frames Dan Hatola Excel Programming 5 March 12th 07 03:06 AM
Multiple Frames on a userform James McDowell[_2_] Excel Programming 3 May 3rd 05 05:20 AM
Problem with Frames in userform JUAN Excel Programming 2 October 27th 04 12:13 AM
overlaying frames on a userform Mike[_49_] Excel Programming 0 January 28th 04 11:41 PM


All times are GMT +1. The time now is 03:08 AM.

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"