Hi,
I'm slowly getting a little better but I'm stuck. My formula is not extending and I'd like simply have the userform copy the formula down from the row above whenever I enter new data using a userform.
I found some posts and tried to piece together a solution. The data entry part works but copying the formula is not working.
Any help appreciated:
'get next empty row
lRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
'copy the data to the spreadsheet
With ws
.Cells(lRow, 1).Value = Me.txtStudent.Value
.Cells(lRow, 2).Value = Me.txtDate.Value
.Cells(lRow, 3).Value = (Format(Me.txtDate.Value, "dddd"))
.Cells(lRow, 4).Value = Me.txtPeriod.Value
.Cells(lRow, 5).Value = Me.cmbClass.Value
.Cells(lRow, 6).Value = Me.CkExcused.Value
.Cells(lRow, 7).Value = Me.txtEngaged.Value
.Cells(lRow, 9).Value = Me.txtFlwDir.Value
'update formula
.Cells(1Row -1, 8).Resize(2, 1).Formula = Cells(1Row -1, 8).Formula
End With
I'm slowly getting a little better but I'm stuck. My formula is not extending and I'd like simply have the userform copy the formula down from the row above whenever I enter new data using a userform.
I found some posts and tried to piece together a solution. The data entry part works but copying the formula is not working.
Any help appreciated:
'get next empty row
lRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
'copy the data to the spreadsheet
With ws
.Cells(lRow, 1).Value = Me.txtStudent.Value
.Cells(lRow, 2).Value = Me.txtDate.Value
.Cells(lRow, 3).Value = (Format(Me.txtDate.Value, "dddd"))
.Cells(lRow, 4).Value = Me.txtPeriod.Value
.Cells(lRow, 5).Value = Me.cmbClass.Value
.Cells(lRow, 6).Value = Me.CkExcused.Value
.Cells(lRow, 7).Value = Me.txtEngaged.Value
.Cells(lRow, 9).Value = Me.txtFlwDir.Value
'update formula
.Cells(1Row -1, 8).Resize(2, 1).Formula = Cells(1Row -1, 8).Formula
End With