Good Afternoon,
I have been using the code below to save information to an external workbook via a submit button. I have been asked to load the info into a userform by a managers name so individuals can work within their team which i have managed to accomplish with help.
I now need to amend the VB below to save by Manager name ( which is held in column "C" ) and then carry on as per below. The VB below works on the last empty cell in column N ( "14" ) Is there anyway the code below can be amended or would it need to be re written.
I have been using the following code above to search by TM to open the userform.
On the userform i have the submit button on the managers name is in "textbox1"
I hope you can help
Thanks
Gavin
I have been using the code below to save information to an external workbook via a submit button. I have been asked to load the info into a userform by a managers name so individuals can work within their team which i have managed to accomplish with help.
I now need to amend the VB below to save by Manager name ( which is held in column "C" ) and then carry on as per below. The VB below works on the last empty cell in column N ( "14" ) Is there anyway the code below can be amended or would it need to be re written.
Rich (BB code):
lRow = Range("C" & Rows.Count).End(xlUp).Row
For Each cell In Range("C1:C" & lRow)
If cell.Value = ComboBox2.Value Then
I have been using the following code above to search by TM to open the userform.
On the userform i have the submit button on the managers name is in "textbox1"
I hope you can help
Thanks
Gavin
Rich (BB code):
'Submit code
Dim iRow As Long
Dim ws As Worksheet
If Me.JEN.Value = "" Then
MsgBox "Please Complete is this a justified Enquiry"
Else
If Me.AComm.Value = "" Then
MsgBox "Please Leave Your Comments"
Else
If Me.CBoxAdd.Value = "" Then
MsgBox "Please Enter Your Name"
Else
'Workbooks.Open Filename:="C:\Users\MAZZA\Documents\Gavin\Car Park\FYVData.xls" 'Home
Workbooks.Open Filename:="\\W2K6082\COMMON\SHARED\Gavin Mazza\Car Park\FYVData.xls"
If UserForm1.TextBox13 = "Laura Haynes" Then
ActiveWorkbook.Sheets("Laura Haynes").Activate
Unload Me
Set ws = Worksheets("Laura Haynes")
iRow = ws.Cells(Rows.Count, 14) _
.End(xlUp).Offset(1, 0).Row
'copy the data to the database
ws.Cells(iRow, 14).Value = Me.JEN.Value
ws.Cells(iRow, 16).Value = Me.TextBox12.Value
ws.Cells(iRow, 15).Value = Me.ComboBox2.Value
ws.Cells(iRow, 17).Value = Me.AComm.Value
ws.Cells(iRow, 18).Value = Me.CBoxAdd.Value
'clear the data
Me.JEN.Value = ""
Me.AComm.Value = ""
Me.CBoxAdd.Value = ""
Me.TextBox12.Value = ""
Me.txtdate.Enabled = True
Workbooks("FYVData.xls").Close True
End If
End If
End If
End If