Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How would I clear the contents of all Sheets in my file? I can record
a macro that will clear the contents of a specific, but I have multiple sheets and was wondering if there is a nice easy way Newbie here Thanks Timmie |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
If you going to do that why not simply delete the workbook. But if you want another method use this. BEWARE it will delete everything so make sure thats what you want. Alt+Fll to open Vb editor. Right click a worksheet tab, view code and psate this in. Sub clearall() Dim ws As Worksheet For x = 1 To ThisWorkbook.Worksheets.Count Worksheets(x).UsedRange.ClearContents Next End Sub Mike " wrote: How would I clear the contents of all Sheets in my file? I can record a macro that will clear the contents of a specific, but I have multiple sheets and was wondering if there is a nice easy way Newbie here Thanks Timmie |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Mike that works a dream. Didn't want to delete the
worksheets as I have formats setup, so each week I copy in different data (but require the same formats) Tim |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Once your workbook is clear, see if saving your workbook as a "Template"
might be an option for you. -- Dana DeLouis wrote in message ... Thank you Mike that works a dream. Didn't want to delete the worksheets as I have formats setup, so each week I copy in different data (but require the same formats) Tim |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Glad that helped and thanks for the feedback. BTW my response was a cut from another sub and I included this line which isn't necessary Dim ws As Worksheet Mike " wrote: Thank you Mike that works a dream. Didn't want to delete the worksheets as I have formats setup, so each week I copy in different data (but require the same formats) Tim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear Contents | Excel Discussion (Misc queries) | |||
Clear Contents | Excel Programming | |||
Clear Contents | Excel Programming | |||
Macro to clear range contents when cell contents are changed by us | Excel Programming | |||
Clear contents | Excel Programming |