Hey all.
I came up with the following routine to check to see if the last useable row has been used in a sheet that I have designed.
AppendRows is another script that asks for a user input and copies and pastes the last row X number of times. I came up with the above to force the user to run the AppendRows before accidentally filling out the last row. If that happens, AppendRows copies and pastes the data they put in the last row.
This was done to save on file size as there are about 60 columns of calculations.
It works fine when the user switches tabs.
The problem is that if a user fills in what is the last useable line and then closes the workbook, the routine does not catch it the next time it runs.
Is there a way that I can also have the check done on whatever the active sheet is when the workbook opens?
Thanks
I came up with the following routine to check to see if the last useable row has been used in a sheet that I have designed.
Code:
Private Sub Worksheet_Activate()
If Cells(Rows.Count, 1).End(xlUp).Offset(0, 1).Value = "" And _
Cells(Rows.Count, 1).End(xlUp).Offset(-1, 1).Value <> "" Then
AppendRows
End If
End Sub
AppendRows is another script that asks for a user input and copies and pastes the last row X number of times. I came up with the above to force the user to run the AppendRows before accidentally filling out the last row. If that happens, AppendRows copies and pastes the data they put in the last row.
This was done to save on file size as there are about 60 columns of calculations.
It works fine when the user switches tabs.
The problem is that if a user fills in what is the last useable line and then closes the workbook, the routine does not catch it the next time it runs.
Is there a way that I can also have the check done on whatever the active sheet is when the workbook opens?
Thanks