Putting a Check or an X in cell

Emoncada

Active Member
Joined
Mar 23, 2005
Messages
409
Is there a macro that when i click in a cell it will put a check or and X in the cell?
 
I am going to need to use a macro for that because the If statement get's overwritten when double clicked on.
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
AHHH, in that case, it's probably simpler to follow your initial instinct and use the earlier code with If()'s. That's not to say that I COULDN'T do it with code... but if the Of()'s will do it, I think it'll be easier (for me :biggrin: )
 
Upvote 0
I am going to need to use a macro for that because the If statement get's overwritten when double clicked on.
redefine Check to be ONLY G12, J12, M12, G29, J29, and M29... that should fix it...
 
Upvote 0
LOL, That's true just the If statement get overwritten when double clicked. Do you know a better way? or how I can fix that problem?

My If statement is

IN: G12

=IF(G11="X","X","")
 
Upvote 0
Hello Emoncada,
Here's something you can try.
Perhaps on a separate sheet from the one hatman is helping you with just to compare which
way you want to go.
This uses the single click (selection) rather than the double click.
It will only fire when cells in columns G or H, J or K, M or N (in rows 12 or 29) get selected.
(If you're going to be inserting/deleting rows then I'd look at using named ranges instead
of hard coded rows.)
Anyway, just for fun try this.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Intersect(Target, Range("G12:H12, J12:K12, M12:N12")) Is Nothing And _
   Intersect(Target, Range("G29:H29, J29:K29, M29:N29")) Is Nothing Then Exit Sub
  
Select Case Target.Row
  Case 12
    Target.Resize(13).Font.Name = "Marlett"
    If Target = "" Then
      Target.Resize(13).Value = "a"
    Else
      Target.Resize(13).Value = ""
    End If
  Case 29
    Target.Resize(12).Font.Name = "Marlett"
    If Target = "" Then
      Target.Resize(12).Value = "a"
    Else
      Target.Resize(12).Value = ""
    End If
End Select
  
End Sub
 
Upvote 0
That works pretty good the only thing is not in all cases would all of them be checked, that's only if all are GOOD, If there is one thing BAD then I would need to be able to check then individually.

Example.

.................G..............H
..............Good........BAD
.......ALL ( )........( )
Horn......( )........( )
Lights.....( ).........( )

If the Horn and lights, and everything else on that section of G12:G23 are Good then I can click on G11 and all are checked, but if Horn is not working then I need to be able to check that as bad and then everything else as good. you have any ideas, I hope that helps.
 
Upvote 0
Sorry, I got it to work with hatman's first code and your code, thanks a lot to both of you. Great Job I have one other problem I posted yesterday, I don't know if you can help with that.
 
Upvote 0

Forum statistics

Threads
1,214,869
Messages
6,122,012
Members
449,060
Latest member
LinusJE

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top