Hello
I am using the code below to enter data from my data entry form, but it adds the new entry to the bottom of the data, i have a macro which inserts a new line at the begining of the data set and i want the date to go into that cell rather than at the end, hoping someone can assist
Private Sub cmdOK_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("IVDR - Project Tracker")
iRow = Cells(ws.Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(iRow, 1).Value = Me.txtID.Value
.Cells(iRow, 2).Value = Me.txtQuote.Value
.Cells(iRow, 3).Value = Me.txtProj.Value
.Cells(iRow, 4).Value = Me.txtCus.Value
.Cells(iRow, 5).Value = Me.txtCon.Value
End With
'clear the data
Me.txtID.Value = ""
Me.txtQuote.Value = ""
Me.txtProj.Value = ""
Me.txtCus.Value = ""
Me.txtCon.Value = ""
Unload Me
End Sub
I am using the code below to enter data from my data entry form, but it adds the new entry to the bottom of the data, i have a macro which inserts a new line at the begining of the data set and i want the date to go into that cell rather than at the end, hoping someone can assist
Private Sub cmdOK_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("IVDR - Project Tracker")
iRow = Cells(ws.Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(iRow, 1).Value = Me.txtID.Value
.Cells(iRow, 2).Value = Me.txtQuote.Value
.Cells(iRow, 3).Value = Me.txtProj.Value
.Cells(iRow, 4).Value = Me.txtCus.Value
.Cells(iRow, 5).Value = Me.txtCon.Value
End With
'clear the data
Me.txtID.Value = ""
Me.txtQuote.Value = ""
Me.txtProj.Value = ""
Me.txtCus.Value = ""
Me.txtCon.Value = ""
Unload Me
End Sub