View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
inbound03[_3_] inbound03[_3_] is offline
external usenet poster
 
Posts: 1
Default What's wrong with my NextRow code?

HI John:

I got it figured out and it works nicely. I posted the full code her
to solicit your comment. Also, I hope you can help me answer th
following two questions:

1. Is there anyway I can make the the cells that contain the data t
adjust automatically to fit the information?

2. How can I work around the text being truncated if I have more tha
256 characters in a cell.

Thanks in advance and HAPPY NEW YEAR!

Alex

User clicks the checkbox to activate the frame that contains the "YES"
"NO", and 'N/A" option buttons:

'Select to make the options appear; disslect to hide the options
Private Sub chk27_Click()
If chk27 = True Then
Frame27.Visible = True
Else
Frame27.Visible = False
chk27 = False
End If
End Sub


When user select the "NO" button:

'Action to be performed when the "No" button is clicked
Private Sub opt27No_Click()

Sheets("Report").Range("H177") = "No"

'Show combo box in UserForm
If opt27No = True Then
FrameConcernCargo.Visible = True

'Select the corresponding question number, category
Corrective Action
Qnum = Sheets("RiskMatrix").Range("A20")
Cat = Sheets("RiskMatrix").Range("b20")
Action = Sheets("RiskMatrix").Range("c20")
'Select and show the corresponding concern in the combo box i
UserForm
cmbConcernCargo.RowSource = "RiskMatrix!$w$2:$w$3"
Else
FrameConcernCargo.Visible = False
End If

End Sub

User will choose a concern statement and all related informatio
(question number, category, cocnern, and corrective action) will poste
on the next sheet starting A54

'Hide the combo box and the OK button after transferring respectiv
concern to "Recap"
Private Sub cmdCargoEnter_Click()

'Hide the frame
FrameConcernCargo.Visible = False

'Check for completeness
If cmbConcernCargo.Text = "" Then
MsgBox "Please select the security concern"
FrameConcernCargo.Visible = True
Exit Sub
End If

' Find next available row
NextRow = Sheets("Recap").Range("a5000").End(xlUp).Row + 1

' Transfer the data
Sheets("Recap").Cells(NextRow, 1) = Qnum
Sheets("RiskMatrix").Range(Qnum)
Sheets("Recap").Cells(NextRow, 2) = Cat
Sheets("RiskMatrix").Range(Cat)
Sheets("Recap").Cells(NextRow, 4) = cmbConcernCargo.Text & Chr(15)
Sheets("Recap").Cells(NextRow, 7) = Action
Sheets("RiskMatrix").Range(Action)

' Reset the Userform for the next row
cmbConcernCargo = ""

End Su

--
Message posted from http://www.ExcelForum.com