|
-
Oct 3rd, 2005, 11:15 AM
#1
Thread Starter
Junior Member
LookupVal = Yr+Mo B4 laying in user input
I need help editing the code -- in order to make it utilize: 'LookupVal = cboYear.Value + cboMonth.Value before laying in the user entry into the pink columns. (image of table rec'vg the user input attached)
How it works:
1) Welcome Screen, 2) "RGUserEntry" User entry form where they enter how many, etc.
3) User entry form (shown below "RGCNA") where they type in the Cause for poor performance and an Action they plan to take to correct the problem. ( this verbiage should feed straight into the pink columns AFTER it locates the appropriate YEAR + MONTH row.....that the user already selected in the previous form.
Specifically, the CNA form needs to first LookupVal = cboYear.Value + cboMonth.Value (then) go to Col J to lay in the user input placed in (txtCYTcause.Text) and lay in (txtCYTAction.Text) next to it in Col K....
then, follow suit with putting (txtEFFCause.Text) & (txtEFFAction.Text) in Col S & T......etc.
Here's my first stab at it -- but I'm stuck:
if you have a better idea -- please throw all this out and suggest what you feel will work better to achieve the above request....THANK YOU very much in advance for your help!
____________________________________________________
Code:
Private Sub cmdSaveNClose_Click()
'this is where CNA form closes and dumps verbiage into rawdata sheet
Dim LookupVal As String
Dim RowNum As Long
frmRGCNA.Hide
Dim CNAout As Range
'-------------------------------------------------
'Code gets stopped at the below row...but not sure why?_
'I know it needs a line of direction to first go perform the LookupVal_
'but not sure how to incorporate it within the below...?
Set CNAout = Worksheets("UFDATA").Cells(RowNum, 4)
With CNAout
.Offset(0, 0) = txtCYTcause.Text
.Offset(0, 1) = txtCYTAction.Text
.Offset(0, 9) = txtEFFCause.Text
.Offset(0, 10) = txtEFFAction.Text
.Offset(0, 19) = txtTIMCause.Text
.Offset(0, 20) = txtTIMAction.Text
.Offset(0, 28) = txtQUACause.Text
.Offset(0, 29) = txtQUAAction.Text
End With
End Sub
'------------------------------------------------------
Private Sub UserForm_Initialize()
'this code tells the data where to be placed within the rawdata sheet
Dim lngValue As Long
txtCYTcv = Worksheets("UFDATA").Cells(RowNum, 4).Offset(1, 2)
txtEFFcv = Worksheets("UFDATA").Cells(RowNum, 4).Offset(1, 2)
txtTIMcv = Worksheets("UFDATA").Cells(RowNum, 4).Offset(1, 2)
txtQUAcv = Worksheets("UFDATA").Cells(RowNum, 4).Offset(1, 2)
'-----------------------------------------------------------------
'the below section defines the parameters for colorization for Cycle Time
'will need to repeat this chunk over and over for EFF, TIME & QUA
'CYCLE TIME
lngValue = Worksheets("UFDATA").Cells (RowNum, 4)
If lngValue <= 0 Then
frmRGCNA.txtCYTcv.BackColor = vbBlue
ElseIf lngValue <= 45 Then
frmRGCNA.txtCYTcv.BackColor = vbGreen
ElseIf lngValue <= 50 Then
frmRGCNA.txtCYTcv.BackColor = vbYellow
Else
frmRGCNA.txtCYTcv.BackColor = vbRed
End If
'repeats this chunk of code for EFFICIENCY, TIMELINESS & QUALITY
Last edited by ChrisOK; Oct 5th, 2005 at 10:23 AM.
Reason: new clarity and another image to help visualize
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|