I am trying to set up a user form that will add new employees to a database. I have a couple of columns that will just have formulas, here is what I am working with:
RowCount = historyWks.Range("A1").CurrentRegion.Rows.Count
With historyWks.Range("A1")
.Offset(RowCount, 0).Value = Me.txtEmployeeID.Value
.Offset(RowCount, 1).Value = Me.txtFirstName.Value
.Offset(RowCount, 2).Value = Me.txtMiddleName.Value
.Offset(RowCount, 3).Value = Me.txtLastName.Value
.Offset(RowCount, 4).Value = Me.txtUnionClass.Value
.Offset(RowCount, 5).Value = DateValue(Me.txtDOH.Value)
.Offset(RowCount, 6).Value = Me.cboJob.Value
.Offset(RowCount, 7).Value = "=VLOOKUP(G2,Projects!$A$1:$F$88,2)"
.Offset(RowCount, 13).Value = Format(Now, "mm/dd/yyyy hh:mm:ss am/pm")
.Offset(RowCount, 14).Value = Application.UserName
End With
Is it possible to get it to update to the correct row, so that if the data is being entered on line 500 the formula will change to G500 instead of G2?
Thanks!
Bookmarks