#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default check boxes

I have several check boxes on a sheet. I want to check
these boxes and return a 'Y' if it has been selected and
a 'N' if it hasn't.

Thanks in advance.

gareth
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default check boxes

What kind of checkboxes. ActiveX from the control toolbox toolbar or excel
checkboxes from the forms toolbar. When do you want them to return Y or N?
When the control is checked. If so, then without code, link the checkboxes
to the cell over which they are located and which will contain True or
False. Then in another cell, put in a formula like =if(b9,"Y","N") where
B9 is the linked cell.

Otherwise you would need to not linke the checkbox and use event code to
place the Y or N in the cell.

--
Regards,
Tom Ogilvy

"gareth" wrote in message
...
I have several check boxes on a sheet. I want to check
these boxes and return a 'Y' if it has been selected and
a 'N' if it hasn't.

Thanks in advance.

gareth



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default check boxes

From the Forms toolbar.

I want to return a 'Y' or a 'N' in a macro. Should I link
the cells and do it that way or is there another way?

gareth
-----Original Message-----
What kind of checkboxes. ActiveX from the control

toolbox toolbar or excel
checkboxes from the forms toolbar. When do you want them

to return Y or N?
When the control is checked. If so, then without code,

link the checkboxes
to the cell over which they are located and which will

contain True or
False. Then in another cell, put in a formula like =if

(b9,"Y","N") where
B9 is the linked cell.

Otherwise you would need to not linke the checkbox and

use event code to
place the Y or N in the cell.

--
Regards,
Tom Ogilvy

"gareth" wrote in

message
...
I have several check boxes on a sheet. I want to check
these boxes and return a 'Y' if it has been selected and
a 'N' if it hasn't.

Thanks in advance.

gareth



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default check boxes

Public Sub Btn_click()
Dim sName As String, cbx As CheckBox
Dim rng As Range
sName = Application.Caller
Set cbx = ActiveSheet.CheckBoxes(sName)
Set rng = cbx.TopLeftCell.Offset(0, -1)
If cbx = xlOn Then
rng.Value = "Y"
Else
rng.Value = "N"
End If
End Sub

Assign this to all your checkboxes. It puts Y or N to the cell to the left
of the cell with the checkbox over it.

Or adjust it to fit you needs.

--
Regards,
Tom Ogilvy

"gareth" wrote in message
...
From the Forms toolbar.

I want to return a 'Y' or a 'N' in a macro. Should I link
the cells and do it that way or is there another way?

gareth
-----Original Message-----
What kind of checkboxes. ActiveX from the control

toolbox toolbar or excel
checkboxes from the forms toolbar. When do you want them

to return Y or N?
When the control is checked. If so, then without code,

link the checkboxes
to the cell over which they are located and which will

contain True or
False. Then in another cell, put in a formula like =if

(b9,"Y","N") where
B9 is the linked cell.

Otherwise you would need to not linke the checkbox and

use event code to
place the Y or N in the cell.

--
Regards,
Tom Ogilvy

"gareth" wrote in

message
...
I have several check boxes on a sheet. I want to check
these boxes and return a 'Y' if it has been selected and
a 'N' if it hasn't.

Thanks in advance.

gareth



.



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
Copy and move check box (check boxes) with new cell link? Marty Excel Worksheet Functions 1 January 20th 10 07:43 PM
How do I increase the size of check in check boxes Adams, Les Excel Discussion (Misc queries) 0 September 19th 06 02:35 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
How do i create a value for check boxes or option boxes Tim wr Excel Discussion (Misc queries) 1 February 9th 06 10:29 PM
Check Box influencing other Check Boxes iwrk4dedpr[_2_] Excel Programming 0 May 20th 04 12:55 AM


All times are GMT +1. The time now is 09:47 PM.

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"