'Clear the Multiple Page content in simple coding
Hi I am having 11 sheets in my workbook. I need to delete some contents in all the sheets except 1 sheet. I have written some code. while I am rund the code activesheet content will be deleted. rest of the contents not deleted. Please help on this. Here is my code
Sub ClearData()
Dim sheetsArray As Sheets
Set sheetsArray = ActiveWorkbook.Sheets(Array("Qns1", "Qns2", "Qns3", "Qns4", "Qns5", "Adl1", "Adl2", "Adl3", "Adl4", "Adl5"))
Dim sheetObject As Worksheet
' change value of range 'a1' on each sheet from sheetsArray
For Each sheetObject In sheetsArray
'Do something
Range("B2:C1000,E2:O1000").ClearContents
Next sheetObject
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|