Tags: cell, engineers, event, excel, fairly, foryes, microsoft, mousedown, msdn, puts, red, software, spreadsheet, suppose, yesbox

on mousedown event for a cell?

On Microsoft » Microsoft Excel

2,277 words with 1 Comments; publish: Mon, 26 May 2008 15:24:00 GMT; (30678.13, « »)

One of our engineers has this fairly long spreadsheet. He as a cell for

yes and no, and if it's suppose to be yes, he puts a red X in the yes

Box. There is a cell that has a formula so if this cell equals X, it

displays a certain formula.

We were trying to get away from having to manually put an X in the box,

want to be able to just click with the mouse and it is inserted

automatically, or if clicked again, goes away.

Does anyone have any ideas, I've been toying around, but to no success

at the moment.

** Posted via: http://www.ozgrid.com

Excel Templates, Training, Add-ins & Business Software Galore!

Free Excel Forum http://www.ozgrid.com/forum ***

All Comments

Leave a comment...

  • 1 Comments
    • Hi

      one way: put the following code in your worksheet module:

      Private Sub Worksheet_SelectionChange(ByVal Target As Range)

      If Target.Cells.Count > 1 Then Exit Sub

      If Intersect(Target, Me.Range("D:D")) Is Nothing Then Exit Sub

      On Error GoTo CleanUp

      Application.EnableEvents = False

      With Target

      If .Value <> "" Then

      .Value = ""

      Else

      .Value = "X"

      End If

      End With

      CleanUp:

      Application.EnableEvents = True

      End Sub

      Regards

      Frank Kabel

      Frankfurt, Germany

      Jonathon Baddock wrote:

      > One of our engineers has this fairly long spreadsheet. He as a cell

      > for yes and no, and if it's suppose to be yes, he puts a red X in the

      > yes Box. There is a cell that has a formula so if this cell equals

      > X, it displays a certain formula.

      > We were trying to get away from having to manually put an X in the

      > box, want to be able to just click with the mouse and it is inserted

      > automatically, or if clicked again, goes away.

      > Does anyone have any ideas, I've been toying around, but to no

      > success at the moment.

      > ** Posted via: http://www.ozgrid.com

      > Excel Templates, Training, Add-ins & Business Software Galore!

      > Free Excel Forum http://www.ozgrid.com/forum ***

      #1; Mon, 26 May 2008 15:25:00 GMT