Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Lloyd Alvarez   on Sep 07 In MS Office Category.

  
Question Answered By: Vidisha Pathak   on Sep 07

I'm not sure that your use of the locked/unlocked cells
has anything to do with what you're asking.
I think the problems is with the range  selection.
I tried this:
Private Sub ClearButton1_Click()
Dim ocell As Range
Range("G3").ClearContents
For Each ocell In Range("E5:E12")
ocell.ClearContents
Next ocell
End Sub

and it worked just fine.

the way you've defined your range:
Range("E5:E12", "G3").Select
Isn't giving you the results you expect.
it's actually selecting range E3:G12 (try using the debugger to step
through)
And, actually, it isn't strictly necessary to select the cells.

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Clear Button in excel spreadsheet Or get search suggestion and latest updates.


Tagged: