Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Macro to make a cell work like a check

I'm very new to macro part of Excel.
I have created a number of boxes (cells with borders) in
basic forms that a made.
I was wondering if there is a way to write a macro too
make the boxes work like a check box, but have an 'X' show
up in it rather than a check, when it is clicked?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Macro to make a cell work like a check

Try the following:
1) Place a rectangle from the Drawing toolbar over the
cell. Ensure that the top left corner of the rectangle
does not go beyond the cell boundary.
2) Right click the rectangle and select Format Autoshape.
3) Select the Colors and Lines tab.
4) Select No Fill and No Line from the Colors and Lines
menu. It should appear invisible.
5) Right click the rectangle again and select Assign Macro.
6) Assign the following macro to the rectangle.

Sub CheckBoxCells()
Dim C As Range
Set C = ActiveSheet.Shapes(Application.Caller).TopLeftCell
If C.Value = "X" Then C.Value = "" Else C.Value = "X"
End Sub

Note that if you change your mind about the "X" you can
make it a check mark by formating the cell font
as "Marlett" and substituting the lower case "a" for
the "X" in the code. Alternatively, the lower case "h"
will toggle as a large square (bullet).

Regards,
Greg

-----Original Message-----
I'm very new to macro part of Excel.
I have created a number of boxes (cells with borders) in
basic forms that a made.
I was wondering if there is a way to write a macro too
make the boxes work like a check box, but have an 'X'

show
up in it rather than a check, when it is clicked?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Macro to make a cell work like a check

It took me a couple minutes to figure it out but I got it
to work(very new at this).
I wasn't naming the macro "CheckBoxCells". I think that me
work for me.

Thnks for your help Greg


-----Original Message-----
Try the following:
1) Place a rectangle from the Drawing toolbar over the
cell. Ensure that the top left corner of the rectangle
does not go beyond the cell boundary.
2) Right click the rectangle and select Format

Autoshape.
3) Select the Colors and Lines tab.
4) Select No Fill and No Line from the Colors and Lines
menu. It should appear invisible.
5) Right click the rectangle again and select Assign

Macro.
6) Assign the following macro to the rectangle.

Sub CheckBoxCells()
Dim C As Range
Set C = ActiveSheet.Shapes(Application.Caller).TopLeftCell
If C.Value = "X" Then C.Value = "" Else C.Value = "X"
End Sub

Note that if you change your mind about the "X" you can
make it a check mark by formating the cell font
as "Marlett" and substituting the lower case "a" for
the "X" in the code. Alternatively, the lower case "h"
will toggle as a large square (bullet).

Regards,
Greg

-----Original Message-----
I'm very new to macro part of Excel.
I have created a number of boxes (cells with borders) in
basic forms that a made.
I was wondering if there is a way to write a macro too
make the boxes work like a check box, but have an 'X'

show
up in it rather than a check, when it is clicked?
.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
make a check form, and then have info go to a check register richie g Excel Worksheet Functions 0 May 5th 10 12:10 AM
Make them work on the Each cell Value Steved Excel Worksheet Functions 7 June 30th 09 04:39 PM
How do I make the check mark boc bigger on the check box? srod Excel Discussion (Misc queries) 0 October 6th 08 09:52 PM
Make table query will work in datasheet view but will not make tab WildlyHarry Excel Discussion (Misc queries) 0 August 28th 07 03:06 PM
How can i make this work within an IF statement: (41<=Cell<=46) velopoav New Users to Excel 3 April 11th 05 02:15 AM


All times are GMT +1. The time now is 05:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"