How to I delete all of the rows except the header row from multiple worksheets but not all of the worksheets?
I really appreciate all of the help that you give me! As you can see, I'm not a VB programmer!
Thanks!
How to I delete all of the rows except the header row from multiple worksheets but not all of the worksheets?
I really appreciate all of the help that you give me! As you can see, I'm not a VB programmer!
Thanks!
Use this code in a blank module of your file- Press Alt + F11, on the left hand side you will see Microsoft Excel Objects. Right click and select Insert->Module. Copy the code -Where i have put "A" & "B", replace it with the sheet names where the rows shouldnt be deleted.![]()
Please Login or Register to view this content.
Incase the number of sheets where the rows are to be deleted are more than the number of sheets where it shouldnt, use the above macro. Just in case the number of sheets where the rows shouldnt be deleted are less, reverse this line - changeto![]()
Please Login or Register to view this content.
This will save you time in typing out all the sheet names.![]()
Please Login or Register to view this content.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Hello busiessanalyst,
Welcome to the Forum!
This macro lets you specify the worksheets not to clear. Since the macro clears the sheet based on the UsedRange property, it does not matter if the header row is in row 1. The macro assumes the header row is the first row used on the worksheet.
![]()
Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks