Error 1004 in excel vba

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Radheshyam

Thread Starter
Joined
Nov 12, 2018
Messages
1
Sub Clearcells()
Range("B12", "B4000").Clearcontents
Range("C12", "C4000").Clearcontents
Range("E12", "E4000").Clearcontents
Range("G12", "G4000").Clearcontents
Range("I12", "I4000").Clearcontents
Range("N12", "N4000").Clearcontents
Range("O12", "O4000").Clearcontents
Range("P12", "P4000").Clearcontents
Range("Q12", "Q4000").Clearcontents
Range("R12", "R4000").Clearcontents
Range("T12", "T4000").Clearcontents
Range("U12", "U4000").Clearcontents
Range("V12", "V4000").Clearcontents
Range("W12", "W4000").Clearcontents
Range("X12", "X4000").Clearcontents
Range("Y12", "Y4000").Clearcontents
Range("Z12", "Z4000").Clearcontents
Range("AA12", "AA4000").Clearcontents
Range("AB12", "AB4000").Clearcontents
Range("T4", "T5").Clearcontents
Range("U4", "U5").Clearcontents
Range("V5", "V5").Clearcontents
End Sub

I added this in the excel developer for clear the cells but when I clicked on assistive button it clears all the data but when I protected the sheet it doesn't work it shows 1004 error. please help
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top