03856me
Active Member
- Joined
- Apr 4, 2008
- Messages
- 297
Excel 2007
I have a dataTable where data is entered via a UserForm in columns A-P, starting on row 6 (headers are on row 5). Columns Q-KN contain all formulas are are hidden during input.
Here is the code I have come up with to clear the data, which works ok, except it leave all the rows that do not contain data in rows 6 through ??. The formulas must be kept so when new data is added all goes well. Should I leave one blank row on 6?
Any suggestions on how to protect the formulas and get rid of empty rows?
I have a dataTable where data is entered via a UserForm in columns A-P, starting on row 6 (headers are on row 5). Columns Q-KN contain all formulas are are hidden during input.
Here is the code I have come up with to clear the data, which works ok, except it leave all the rows that do not contain data in rows 6 through ??. The formulas must be kept so when new data is added all goes well. Should I leave one blank row on 6?
Any suggestions on how to protect the formulas and get rid of empty rows?
Code:
Sub ResetData()
Application.ScreenUpdating = False
ActiveSheet.DisplayPageBreaks = False
Sheets("Main Menu").Select
Sheets("data").Visible = True
Sheets("DATA").Select
ActiveSheet.Cells.EntireColumn.Hidden = False
ActiveSheet.Cells.EntireRow.Hidden = False
Range("A6").Select
Range("dataTable[[plot]:[vc3]]").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("dataTable[[L1length]:[Form Class]]").Select
Selection.EntireColumn.Hidden = True
Range("A6").Select
Sheets("data").Visible = False
Application.ScreenUpdating = True
End Sub