I have an Excel 2007 template with a button (btnClear) that when clicked I would like it to delete all the data starting in C3, it must delete from column C to column L.
The thing is we won't know how many rows there will be, because it changes everytime. Throughout the macro I've used the code below to know how many rows of data are in the excel sheet. In the code below, I start looking at B3 because that's when the actual data begins to be populated (the first 2 rows are for column headers) and it places "N/A" to any row that is blank, maybe we can include something similar in the delete code to know how many rows to delete in columns C through L?
All the data begins in row 3 of all the columns.
Thank you in advance!
Dim r As Long
r = .Range("A" & Rows.Count).End(xlUp).Row
.Range("B3:B" & r).Value = "N/A"