Insert a Checkmark

M

Mac 5430

How do I insert a "X" in a cell by single left clicking on a cell, a "X"
will apear. I have a dozen different forms on seperate tabs in one file with
many question that need to be answered by a left click on a cell (to save
time). The cells are in different rolls and columns and tabs

I am not very excel savey

Mac
 
S

Sandy Mann

Right-click on the sheet tab that you want to use and select the sheet tab
name in the VBA Project window. Ensure that the main window has Worksheet
at the top thencopy and paste this code into the Sheet Module:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'Change Range("B2:B50") to the range that you want
If Intersect(Target, Range("B2:B50")) Is Nothing Then Exit Sub

Target.Value = "X"
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
M

Mac 5430

Sandy Mann,

Sorry, I don't understand. Could I email you the file and you make the
change and mail back to me?

Your address is: (e-mail address removed)

I just email it to you

Thank you

Mac
 
S

Sandy Mann

Hi Mac,
Your address is: (e-mail address removed)

No that is not my address - mailinator.com is a spam trap that creates an
account for any e-mails that arrive, holds them for *a few hours* during
which time you can access them, then it deletes them. (There is no need to
sign up to anything it happens automatically for *any* e-mail that arrives).

As I have just come home from having an operation in hospital, I have just
found your post now and so your post is long gone from mailinator.

You can if you wish, send it to me directly by doing what it says in my
signature and replacing the mailinator.com with the real part of my
address - but please do *NOT* post my real address here for confirmation.

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
S

Sandy Mann

This will toggle the X on and off:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'Change Range("B2:B50") to the range that you want
If Intersect(Target, Range("B2:B50")) Is Nothing Then Exit Sub
If Target.Value = "X" Then
Target.Value = ""
Exit Sub
End If
Target.Value = "X"
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top