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: Barney Smith   on Sep 07


Thanks, you're right. The locked/unlocked issue was irrelavant.
The revised code  provided works great! What would be your
suggestion if upon clearing the cells  I do and resetting the focus
with the following used (below), lets say that I want to do all that
the code indicates for clearing but also resets cells G5:G12 with
the following formula on click:

=IF(ISBLANK(E9),0,IF(E9="NM",0,IF(E9="CR",0,G$3)))

Original Code:
Private Sub ClearButton1_Click()

Dim ocell As Range
Range("G3").ClearContents

For Each ocell In Range("E5:E12")
ocell.ClearContents

Range("G3").Select
Range("G3").Activate

Next ocell
End Sub

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: