Single Click/Double Click VBA code??

NutCase

Board Regular
Joined
Dec 10, 2004
Messages
60
Hi I'm new to all this VBA stuff so if you offer any help please use little words!

I would like to know if it is possible to be able to set a condition or macro or something that when you single click in a certain cell it can show a tick and shade it a certain colour and likewise, when you double click in a cell it changes colour and shows another symbol like a "X" or else a tick with an "*" sign?

I need to do this on a spreadsheet that has a cell for each day of the month relative to a particular unit number if that makes sense... The ticks signify the days it has been hired out and the x or the tick with an asterix signifies the day it finished hire...

Any advice or help you can give would be greatly appreciated and I'll forever kiss the ground you walk on! :pray:
 
Thank you! That works great! I'm kissing the dirt under your feet as we speak...


I need it to cover column C to Column AG... I've figured out to change it to column 3 but can't get it to continue to column AG?

Sorry, I'm still learning this VBA stuff!
 
Upvote 0
Thanks that works great - You're a legend!!

Is there also a way on the double click to have the tick "CHAR(252)" also have an asterick symbol next to it? Like the one in Wingdings 2 "CHAR(218)" in Bold?

[/quote]
 
Upvote 0
Try this:

Code:
    If IsEmpty(Target) Then
        Target.Formula = "=CHAR(252)&CHAR(218)"
        Target.Value = Target.Value
        With Target.Font
            .Name = "Wingdings"
            .FontStyle = "Bold"
            .Size = 8
        End With
        Target.Characters(Start:=2, Length:=1).Font.Name = "Wingdings 2"
        Target.Borders.LineStyle = xlContinuous
    Else
        Target.ClearContents
    End If
 
Upvote 0
I have edited the above code for different formats but one thing i noticed was if you click in the cell once it adds in what is required but if you click on it again then it doesnt do anything, you have to move to a different cell before going back to the original.

Ie if you click in cell A1 it turns to "TRUE" however clicking again will have no effect, until you go to another cell and come back, how can this be updated so that it recognises all clicks?
 
Upvote 0

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