Virgo_anil
New Member
- Joined
- Jun 25, 2019
- Messages
- 3
Hi
I am using below formula to unprotect, autofill and protect sheet in excel however it is giving error message.
Sub sbUnProtectSheet()
ActiveSheet.Unprotect "9999"
Set SourceRange = ActiveSheet.Range("B10:H10")
Set FillRange = ActiveSheet.Range("B11:H39")
SourceRange.AutoFill.FillRange
Range("B11").Select
ActiveSheet.Protect "9999", True, True
End Sub
Majority of the cells are blank in sourcerange however I want it to blank out if user enters incorrect details and then click on fix errors.
Can someone please guide on priority basis?
Thanks
Anil
I am using below formula to unprotect, autofill and protect sheet in excel however it is giving error message.
Sub sbUnProtectSheet()
ActiveSheet.Unprotect "9999"
Set SourceRange = ActiveSheet.Range("B10:H10")
Set FillRange = ActiveSheet.Range("B11:H39")
SourceRange.AutoFill.FillRange
Range("B11").Select
ActiveSheet.Protect "9999", True, True
End Sub
Majority of the cells are blank in sourcerange however I want it to blank out if user enters incorrect details and then click on fix errors.
Can someone please guide on priority basis?
Thanks
Anil