MonsterBait
New Member
- Joined
- May 17, 2012
- Messages
- 10
Hi
I was wondering if someone could show me how to simplify this code?
I use Excel 2007
I would like to clear the contents of these named cells.
They all share a common prefix.
The code below works, but I have 20 name cells to clear and it would be really messy to type the lot out.
Sub ClearContents()
Sheets("Sheet1").Range("TestName, TestCategory, TestNumber").Select
Selection.ClearContents
End Sub
Any help will be appreciated.
Cheers,
Alex
I was wondering if someone could show me how to simplify this code?
I use Excel 2007
I would like to clear the contents of these named cells.
They all share a common prefix.
The code below works, but I have 20 name cells to clear and it would be really messy to type the lot out.
Sub ClearContents()
Sheets("Sheet1").Range("TestName, TestCategory, TestNumber").Select
Selection.ClearContents
End Sub
Any help will be appreciated.
Cheers,
Alex