Hi All,
I would like to add a button to a worksheet that will reset all cells to original state (empty, no highlighting, no bordering) with the exception of a few cells which I know in advance. Is there a relatively simple macro to do this?
Hi All,
I would like to add a button to a worksheet that will reset all cells to original state (empty, no highlighting, no bordering) with the exception of a few cells which I know in advance. Is there a relatively simple macro to do this?
I sort of cheated. I did this:
[VBA]Sub ClearSheet1()
Dim rng
Set rng = Sheet1.Range("a3:b20,e3:o100")
rng.ClearContents
rng.Interior.ColorIndex = 0
Sheet1.Range("f3:g100").Borders.LineStyle = xlNone
'NEED TO FIGURE OUT HOW TO WRITE THIS AS ("F3:G&"INTERPLENGTH")
End Sub[/VBA]
The obvious problem is how do I know what length G100 is really going to be. See comment in code...
[VBA]With Sheet1
LastRow = .Cells(.Rows.Count, "G").End(xlUp).Row
.Range("f3:g" & LastRow).Borders.LineStyle = xlNone
End With
[/VBA]
David