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 "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.... (this is bad for several reasons in our case)
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
I've shared this with a lot of people this month looking for a way...but noone seems to know the
Does anyone know how to alter the below code to make it do the above?
'when the user clicks cancel it will close out the form
Private Sub cmdSave_Click()
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
.Offset(0, 0) = TextBox1.Text 'column C
.Offset(0, 3) = TextBox2.Text 'column F
.Offset(0, 9) = TextBox3.Text 'column L
.Offset(0, 10) = TextBox4.Text 'etc.
.Offset(0, 18) = TextBox5.Text
.Offset(0, 19) = TextBox6.Text
' no input from user needed in this category
.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
'now immediately open the next CNA form
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
I GREATLY appreciate any guidance you can provide