![]() |
|
|
|
#1
|
|||
|
|||
|
You are currently looping through all controls looking for check boxes, if the check box is True, you are copying its Captain to column 7.
You'll need to look at that captain to decide if you want to copy the caption to column 7 or the text from the associated text box to column 8, or maybe do both. Perhaps something along the lines of Code:
' Attributes Target
For Each ctrl In Me.Controls
Select Case TypeName(ctrl)
Case Is = "CheckBox"
If Me.Controls(ctrl.Name).Value = True Then
'if it is not an 'Other' chkbox
If Me.Controls(ctrl.Name).Caption <> "Other" Then
.Offset(RowCounter, 7).Value = vbCrLf & Me.Controls(ctrl.Name).Caption
RowCounter = RowCounter + 1
Else
'get number from chkbox name 'dim num at beginning of sub as string
num = Mid(ctrl.Name, 9)
.Offset(RowCounter, 7).Value = vbCrLf & Me.Controls(ctrl.Name).Caption
.Offset(RowCounter, 8).Value = Me.Controls("Textbox" & num).Value
RowCounter = RowCounter + 1
End If
End If
End Select
Next ctrl
|
|
| Tags |
| #macros |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro Needed to Insert Asnwer to A Question in Multiple Choice Format Question
|
rsrasc | Word VBA | 7 | 03-28-2014 12:28 PM |
Checkbox in Userform
|
lukael | Excel Programming | 5 | 02-18-2014 05:20 AM |
Display result in textbox based on the input of another textbox
|
scarymovie | Word VBA | 5 | 05-16-2012 07:05 PM |
| macro on checkbox | macrohelp | Word VBA | 0 | 03-06-2009 03:33 PM |
| resizing a checkbox?? | aceensor | Excel | 0 | 05-10-2006 01:44 PM |