Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DeN DeN is offline
external usenet poster
 
Posts: 15
Default I would like to have a cross in my checkbox rather than a tick

The document I am creating will be rejected if boxes within it are marked
with a tick. The checkbox appears to only activate a tick - can I change
this to a cross?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default I would like to have a cross in my checkbox rather than a tick

There's no way that I know of to do this. A suggestion, if it's that
essential, is to make your own using a rectangle from the Drawing toolbar and
use an underlying cell for the "X" mark. You need to set the Visible property
of the rectangle's Fill and Line to False. You also need to assign a macro to
the rectangle that toggles the cell between "X" and "". I think if you format
the cell's font name to Marlett and toggle an "r" instead it will look better
(an "r" in Marlett looks like an "X").

If you need it to have the 3D appearance, I have code contained in a utility
of mine that can replicate the Sunken 3D special effect which you can apply
to the box. You should be able to make it look the same as the Forms
checkbox. It will be a pain to dissect it out of the utility, so I don't want
to take this step unless it's essential.

Example code that will create what I'm talking about follows. Run it with a
blank sheet active. As usual, the code is "quick and dirty".

Regards,
Greg

Sub MakeXBox()
Dim shp As Shape
Dim c As Range
Dim L As Single, T As Single
Dim W As Single, H As Single

Set c = ActiveSheet.Range("C5")
With c
.Offset(-1, -1).Resize(3, 3).Interior.ColorIndex = 15
.Interior.ColorIndex = xlNone
.BorderAround xlContinuous, xlThin
.Font.Name = "Marlett"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Size = 9
.ColumnWidth = 1.5
.Value = "r"
.Offset(-1).RowHeight = 5
.Offset(0, -1).ColumnWidth = 0.5
.Offset(1).RowHeight = 5
.Locked = False
With .Offset(, 1)
.ColumnWidth = 15
.Value = "Test 1234"
.VerticalAlignment = xlCenter
End With
L = .Left - 4: T = .Top - 4
W = 100: H = .Height + 10
End With
With ActiveSheet
.Rows(c.Row).RowHeight = .Columns(c.Column).Width
Set shp = .Shapes.AddShape(1, L, T, W, H)
With shp
.Fill.Visible = False
.Line.Visible = False
.OnAction = "TogXBox"
End With
.Protect
End With
ActiveWindow.DisplayGridlines = False
End Sub
Sub TogXBox()
With ActiveSheet.Shapes(Application.Caller).TopLeftCell (2, 2)
If .Value = "r" Then .Value = "" Else .Value = "r"
End With
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
DeN DeN is offline
external usenet poster
 
Posts: 15
Default I would like to have a cross in my checkbox rather than a tick

Hi Greg

Thanks for your assistance. Unfortunately I only know very basic excel -
when I follow your instructions I come up with an error message "compile
Error: Expected end Sub" - can you assist????

Thanks
Denise


"Greg Wilson" wrote:

There's no way that I know of to do this. A suggestion, if it's that
essential, is to make your own using a rectangle from the Drawing toolbar and
use an underlying cell for the "X" mark. You need to set the Visible property
of the rectangle's Fill and Line to False. You also need to assign a macro to
the rectangle that toggles the cell between "X" and "". I think if you format
the cell's font name to Marlett and toggle an "r" instead it will look better
(an "r" in Marlett looks like an "X").

If you need it to have the 3D appearance, I have code contained in a utility
of mine that can replicate the Sunken 3D special effect which you can apply
to the box. You should be able to make it look the same as the Forms
checkbox. It will be a pain to dissect it out of the utility, so I don't want
to take this step unless it's essential.

Example code that will create what I'm talking about follows. Run it with a
blank sheet active. As usual, the code is "quick and dirty".

Regards,
Greg

Sub MakeXBox()
Dim shp As Shape
Dim c As Range
Dim L As Single, T As Single
Dim W As Single, H As Single

Set c = ActiveSheet.Range("C5")
With c
.Offset(-1, -1).Resize(3, 3).Interior.ColorIndex = 15
.Interior.ColorIndex = xlNone
.BorderAround xlContinuous, xlThin
.Font.Name = "Marlett"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Size = 9
.ColumnWidth = 1.5
.Value = "r"
.Offset(-1).RowHeight = 5
.Offset(0, -1).ColumnWidth = 0.5
.Offset(1).RowHeight = 5
.Locked = False
With .Offset(, 1)
.ColumnWidth = 15
.Value = "Test 1234"
.VerticalAlignment = xlCenter
End With
L = .Left - 4: T = .Top - 4
W = 100: H = .Height + 10
End With
With ActiveSheet
.Rows(c.Row).RowHeight = .Columns(c.Column).Width
Set shp = .Shapes.AddShape(1, L, T, W, H)
With shp
.Fill.Visible = False
.Line.Visible = False
.OnAction = "TogXBox"
End With
.Protect
End With
ActiveWindow.DisplayGridlines = False
End Sub
Sub TogXBox()
With ActiveSheet.Shapes(Application.Caller).TopLeftCell (2, 2)
If .Value = "r" Then .Value = "" Else .Value = "r"
End With
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I would like to have a cross in my checkbox rather than a tick


Hi Denise,
It would appear that when you copied Greg's code above
you missed the last line:
-- End Sub <--
Dave
Den Wrote:
Hi Greg

Thanks for your assistance. Unfortunately I only know very basic excel
-
when I follow your instructions I come up with an error message
"compile
Error: Expected end Sub" - can you assist????

Thanks
Denise


"Greg Wilson" wrote:

There's no way that I know of to do this. A suggestion, if it's that
essential, is to make your own using a rectangle from the Drawing

toolbar and
use an underlying cell for the "X" mark. You need to set the Visible

property
of the rectangle's Fill and Line to False. You also need to assign a

macro to
the rectangle that toggles the cell between "X" and "". I think if

you format
the cell's font name to Marlett and toggle an "r" instead it will

look better
(an "r" in Marlett looks like an "X").

If you need it to have the 3D appearance, I have code contained in a

utility
of mine that can replicate the Sunken 3D special effect which you can

apply
to the box. You should be able to make it look the same as the Forms
checkbox. It will be a pain to dissect it out of the utility, so I

don't want
to take this step unless it's essential.

Example code that will create what I'm talking about follows. Run it

with a
blank sheet active. As usual, the code is "quick and dirty".

Regards,
Greg

Sub MakeXBox()
Dim shp As Shape
Dim c As Range
Dim L As Single, T As Single
Dim W As Single, H As Single

Set c = ActiveSheet.Range("C5")
With c
.Offset(-1, -1).Resize(3, 3).Interior.ColorIndex = 15
.Interior.ColorIndex = xlNone
.BorderAround xlContinuous, xlThin
.Font.Name = "Marlett"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Size = 9
.ColumnWidth = 1.5
.Value = "r"
.Offset(-1).RowHeight = 5
.Offset(0, -1).ColumnWidth = 0.5
.Offset(1).RowHeight = 5
.Locked = False
With .Offset(, 1)
.ColumnWidth = 15
.Value = "Test 1234"
.VerticalAlignment = xlCenter
End With
L = .Left - 4: T = .Top - 4
W = 100: H = .Height + 10
End With
With ActiveSheet
.Rows(c.Row).RowHeight = .Columns(c.Column).Width
Set shp = .Shapes.AddShape(1, L, T, W, H)
With shp
.Fill.Visible = False
.Line.Visible = False
.OnAction = "TogXBox"
End With
.Protect
End With
ActiveWindow.DisplayGridlines = False
End Sub
Sub TogXBox()
With ActiveSheet.Shapes(Application.Caller).TopLeftCell (2, 2)
If .Value = "r" Then .Value = "" Else .Value = "r"
End With
End Sub



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=494056

  #5   Report Post  
Posted to microsoft.public.excel.programming
DeN DeN is offline
external usenet poster
 
Posts: 15
Default I would like to have a cross in my checkbox rather than a tick

Hi

No - I have double checked it and the last line was copied in

"Desert Piranha" wrote:


Hi Denise,
It would appear that when you copied Greg's code above
you missed the last line:
-- End Sub <--
Dave
Den Wrote:
Hi Greg

Thanks for your assistance. Unfortunately I only know very basic excel
-
when I follow your instructions I come up with an error message
"compile
Error: Expected end Sub" - can you assist????

Thanks
Denise


"Greg Wilson" wrote:

There's no way that I know of to do this. A suggestion, if it's that
essential, is to make your own using a rectangle from the Drawing

toolbar and
use an underlying cell for the "X" mark. You need to set the Visible

property
of the rectangle's Fill and Line to False. You also need to assign a

macro to
the rectangle that toggles the cell between "X" and "". I think if

you format
the cell's font name to Marlett and toggle an "r" instead it will

look better
(an "r" in Marlett looks like an "X").

If you need it to have the 3D appearance, I have code contained in a

utility
of mine that can replicate the Sunken 3D special effect which you can

apply
to the box. You should be able to make it look the same as the Forms
checkbox. It will be a pain to dissect it out of the utility, so I

don't want
to take this step unless it's essential.

Example code that will create what I'm talking about follows. Run it

with a
blank sheet active. As usual, the code is "quick and dirty".

Regards,
Greg

Sub MakeXBox()
Dim shp As Shape
Dim c As Range
Dim L As Single, T As Single
Dim W As Single, H As Single

Set c = ActiveSheet.Range("C5")
With c
.Offset(-1, -1).Resize(3, 3).Interior.ColorIndex = 15
.Interior.ColorIndex = xlNone
.BorderAround xlContinuous, xlThin
.Font.Name = "Marlett"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Size = 9
.ColumnWidth = 1.5
.Value = "r"
.Offset(-1).RowHeight = 5
.Offset(0, -1).ColumnWidth = 0.5
.Offset(1).RowHeight = 5
.Locked = False
With .Offset(, 1)
.ColumnWidth = 15
.Value = "Test 1234"
.VerticalAlignment = xlCenter
End With
L = .Left - 4: T = .Top - 4
W = 100: H = .Height + 10
End With
With ActiveSheet
.Rows(c.Row).RowHeight = .Columns(c.Column).Width
Set shp = .Shapes.AddShape(1, L, T, W, H)
With shp
.Fill.Visible = False
.Line.Visible = False
.OnAction = "TogXBox"
End With
.Protect
End With
ActiveWindow.DisplayGridlines = False
End Sub
Sub TogXBox()
With ActiveSheet.Shapes(Application.Caller).TopLeftCell (2, 2)
If .Value = "r" Then .Value = "" Else .Value = "r"
End With
End Sub



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=494056




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I would like to have a cross in my checkbox rather than a tick


Hi Denise,

Well, I don't know then, I copied the code of Greg's and it works
here.
Someone with more smarts than me will chime in.

Dave
Den Wrote:
Hi

No - I have double checked it and the last line was copied in

"Desert Piranha" wrote:


Hi Denise,
It would appear that when you copied Greg's code above
you missed the last line:
-- End Sub <--
Dave
Den Wrote:
Hi Greg

Thanks for your assistance. Unfortunately I only know very basic

excel
-
when I follow your instructions I come up with an error message
"compile
Error: Expected end Sub" - can you assist????

Thanks
Denise


"Greg Wilson" wrote:

There's no way that I know of to do this. A suggestion, if it's

that
essential, is to make your own using a rectangle from the

Drawing
toolbar and
use an underlying cell for the "X" mark. You need to set the

Visible
property
of the rectangle's Fill and Line to False. You also need to

assign a
macro to
the rectangle that toggles the cell between "X" and "". I think

if
you format
the cell's font name to Marlett and toggle an "r" instead it

will
look better
(an "r" in Marlett looks like an "X").

If you need it to have the 3D appearance, I have code contained

in a
utility
of mine that can replicate the Sunken 3D special effect which you

can
apply
to the box. You should be able to make it look the same as the

Forms
checkbox. It will be a pain to dissect it out of the utility, so

I
don't want
to take this step unless it's essential.

Example code that will create what I'm talking about follows. Run

it
with a
blank sheet active. As usual, the code is "quick and dirty".

Regards,
Greg

Sub MakeXBox()
Dim shp As Shape
Dim c As Range
Dim L As Single, T As Single
Dim W As Single, H As Single

Set c = ActiveSheet.Range("C5")
With c
.Offset(-1, -1).Resize(3, 3).Interior.ColorIndex = 15
.Interior.ColorIndex = xlNone
.BorderAround xlContinuous, xlThin
.Font.Name = "Marlett"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Size = 9
.ColumnWidth = 1.5
.Value = "r"
.Offset(-1).RowHeight = 5
.Offset(0, -1).ColumnWidth = 0.5
.Offset(1).RowHeight = 5
.Locked = False
With .Offset(, 1)
.ColumnWidth = 15
.Value = "Test 1234"
.VerticalAlignment = xlCenter
End With
L = .Left - 4: T = .Top - 4
W = 100: H = .Height + 10
End With
With ActiveSheet
.Rows(c.Row).RowHeight = .Columns(c.Column).Width
Set shp = .Shapes.AddShape(1, L, T, W, H)
With shp
.Fill.Visible = False
.Line.Visible = False
.OnAction = "TogXBox"
End With
.Protect
End With
ActiveWindow.DisplayGridlines = False
End Sub
Sub TogXBox()
With ActiveSheet.Shapes(Application.Caller).TopLeftCell (2, 2)
If .Value = "r" Then .Value = "" Else .Value = "r"
End With
End Sub



--
Desert Piranha



------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread:

http://www.excelforum.com/showthread...hreadid=494056




--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=494056

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
Is there a font that shows a Y as a tick and an N as a cross? julie cooke Excel Discussion (Misc queries) 5 January 29th 08 05:17 PM
Tick mark and cross marks in Cell claude jerry Excel Discussion (Misc queries) 2 August 28th 07 02:52 PM
Possible to: Tick or cross off dates as they go by? Ben Excel Discussion (Misc queries) 8 August 6th 07 08:19 AM
Checkbox to be marked with a cross rather than a tick Den New Users to Excel 1 February 22nd 06 10:04 AM
cannot find cross and tick box just below the toolbars SA UK Setting up and Configuration of Excel 2 September 8th 05 09:50 AM


All times are GMT +1. The time now is 03:54 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"