ChrisOK
Sep 30th, 2005, 11:51 AM
Need to SEND data from userform to a "specific row" within a speadsheet table.....based upon the criteria selected by the user within the user form.
Example: User selects selects "2005" from the year drop down box..... and "OCT" from the month drop down box....then enters all their month-end metrics. User hits SUBMIT (sending it to the database/master holding tank -which is simply a spreadsheet )...ready for chart generation....
Right now, my code sends the metrics to the spreadsheet, but goes to the first available row....
I need it to find the row that has: "2005" (col A) and "OCT" (col B) then, LAY IN THE DATA starting at column C....once it has found the appropriate row to lay the data into.....
(see attached image).....data should go to row 14...then lay in starting at Col C....within all the defined cells to the right.........
I've shared this with a lot of people this month looking for a way...but noone seems to know the answer... :cry:
Does anyone know how to alter the below code to make it do the above?
Private Sub cmdCancel_Click()
'when the user clicks cancel it will close out the form
frmRGUserEntry.Hide
End Sub
Private Sub cmdSave_Click()
frmRGUserEntry.Hide
Dim MetricOut As Range
'get to the end of the list so you can begin population
Set MetricOut = Worksheets("UFDATA").Range("C65536").End(xlUp).Offset(1, 0)
'whatevers in text box 1 put into location 0,0 etc
With MetricOut
'CYCLE TIME
.Offset(0, 0) = TextBox1.Text 'column C
.Offset(0, 3) = TextBox2.Text 'column F
'EFFICIENCY
.Offset(0, 9) = TextBox3.Text 'column L
.Offset(0, 10) = TextBox4.Text 'etc.
'TIMELINESS
.Offset(0, 18) = TextBox5.Text
.Offset(0, 19) = TextBox6.Text
'QUALITY
' no input from user needed in this category
'ACTIVITY
.Offset(0, 37) = TextBox10.Text
.Offset(0, 38) = TextBox9.Text
.Offset(0, 39) = TextBox12.Text
.Offset(0, 40) = TextBox11.Text
.Offset(0, -2) = cboYear.Text
.Offset(0, -1) = cboMonth.Text
End With
'now immediately open the next CNA form
frmRGCNA.Show
End Sub
I GREATLY appreciate any guidance you can provide....
Example: User selects selects "2005" from the year drop down box..... and "OCT" from the month drop down box....then enters all their month-end metrics. User hits SUBMIT (sending it to the database/master holding tank -which is simply a spreadsheet )...ready for chart generation....
Right now, my code sends the metrics to the spreadsheet, but goes to the first available row....
I need it to find the row that has: "2005" (col A) and "OCT" (col B) then, LAY IN THE DATA starting at column C....once it has found the appropriate row to lay the data into.....
(see attached image).....data should go to row 14...then lay in starting at Col C....within all the defined cells to the right.........
I've shared this with a lot of people this month looking for a way...but noone seems to know the answer... :cry:
Does anyone know how to alter the below code to make it do the above?
Private Sub cmdCancel_Click()
'when the user clicks cancel it will close out the form
frmRGUserEntry.Hide
End Sub
Private Sub cmdSave_Click()
frmRGUserEntry.Hide
Dim MetricOut As Range
'get to the end of the list so you can begin population
Set MetricOut = Worksheets("UFDATA").Range("C65536").End(xlUp).Offset(1, 0)
'whatevers in text box 1 put into location 0,0 etc
With MetricOut
'CYCLE TIME
.Offset(0, 0) = TextBox1.Text 'column C
.Offset(0, 3) = TextBox2.Text 'column F
'EFFICIENCY
.Offset(0, 9) = TextBox3.Text 'column L
.Offset(0, 10) = TextBox4.Text 'etc.
'TIMELINESS
.Offset(0, 18) = TextBox5.Text
.Offset(0, 19) = TextBox6.Text
'QUALITY
' no input from user needed in this category
'ACTIVITY
.Offset(0, 37) = TextBox10.Text
.Offset(0, 38) = TextBox9.Text
.Offset(0, 39) = TextBox12.Text
.Offset(0, 40) = TextBox11.Text
.Offset(0, -2) = cboYear.Text
.Offset(0, -1) = cboMonth.Text
End With
'now immediately open the next CNA form
frmRGCNA.Show
End Sub
I GREATLY appreciate any guidance you can provide....