Feb 15, 2005 #1 rwei Programmer Nov 19, 2004 55 US I am trying to initialize/empty all the worksheets within a workbook by using VBScript codes. What's the right way to do this? Thanks.
I am trying to initialize/empty all the worksheets within a workbook by using VBScript codes. What's the right way to do this? Thanks.
Feb 15, 2005 #2 S SkipVought Programmer Dec 4, 2001 47,486 US Hi, Code: Dim ws As Worksheet For Each ws In Worksheets ws.Cells.Delete Next Skip, [sub] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering... "Is there really a DOG?" [/sub] Upvote 0 Downvote
Hi, Code: Dim ws As Worksheet For Each ws In Worksheets ws.Cells.Delete Next Skip, [sub] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering... "Is there really a DOG?" [/sub]
Feb 15, 2005 Thread starter #3 rwei Programmer Nov 19, 2004 55 US This seems to delete cell by cell for all the worksheets in a workbook (I have workbook with 10-20 worksheets)? Is this the best way? I was hoping to initialize/empty workbook in one single lazy code? =), or at least empty worksheet by worksheet thru a loop or something? Upvote 0 Downvote
This seems to delete cell by cell for all the worksheets in a workbook (I have workbook with 10-20 worksheets)? Is this the best way? I was hoping to initialize/empty workbook in one single lazy code? =), or at least empty worksheet by worksheet thru a loop or something?
Feb 15, 2005 #4 S SkipVought Programmer Dec 4, 2001 47,486 US Where do you see, cell-by-cell? Skip, [sub] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering... "Is there really a DOG?" [/sub] Upvote 0 Downvote
Where do you see, cell-by-cell? Skip, [sub] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering... "Is there really a DOG?" [/sub]