C
Chris
I have the following code that will add a record to the next blank row.
Private Sub cmdAdd_Click()
' Save form contents before changing rows:
SaveRow
' Set current row to first empty row, i.e. one row after
' the last row currently in use:
If Cells(1, 1).Value = "" Then
lCurrentRow = 1 ' (list is empty - start in row 1)
Else
lCurrentRow = ActiveSheet.UsedRange.Rows.Count + 1
End If
' Clear the form for user to add new name:
LoadRow
' Set focus to Name textbox:
txtReqNum.SetFocus
End Sub
What I would like to do is instead of add the userform data to the
blank row is to add a new row and add the userform data to that new
row.
I have existing data in columns A:O (this is also where the new data
from the userform will be added, but in the newly added row) and I have
hidden formulas that counts up the various values of A:O in columns
P:AG. I need the formulas from the previous row that currently has
existing hidden formulas (P:AG) copied to the new row that we just
added in the same range (P:AG). I also have the sums of colums P:AG
added up in the row below the new added row in the same range P:AG in
each of those columns and need the sum formula updated to reflect the
counts of the newly added row data.
I know this may be very complicated (it is for me at least) so any help
would be greatly appreciated. Thanks.
Private Sub cmdAdd_Click()
' Save form contents before changing rows:
SaveRow
' Set current row to first empty row, i.e. one row after
' the last row currently in use:
If Cells(1, 1).Value = "" Then
lCurrentRow = 1 ' (list is empty - start in row 1)
Else
lCurrentRow = ActiveSheet.UsedRange.Rows.Count + 1
End If
' Clear the form for user to add new name:
LoadRow
' Set focus to Name textbox:
txtReqNum.SetFocus
End Sub
What I would like to do is instead of add the userform data to the
blank row is to add a new row and add the userform data to that new
row.
I have existing data in columns A:O (this is also where the new data
from the userform will be added, but in the newly added row) and I have
hidden formulas that counts up the various values of A:O in columns
P:AG. I need the formulas from the previous row that currently has
existing hidden formulas (P:AG) copied to the new row that we just
added in the same range (P:AG). I also have the sums of colums P:AG
added up in the row below the new added row in the same range P:AG in
each of those columns and need the sum formula updated to reflect the
counts of the newly added row data.
I know this may be very complicated (it is for me at least) so any help
would be greatly appreciated. Thanks.