#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Check box macros

Hi there,

On a form if a checkbox is selected (TRUE) then I want the answer in A1 to
be $10.50. If not checked (FALSE) I want the answer in A1to be $2.50. How
do I do this?

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Check box macros

Use a linked cell with that checkbox.

And then you can use a formula that points at that linked cell:

=if(x222=true,10.50,2.50)

(x222 is my linked cell.)

Sunlover wrote:

Hi there,

On a form if a checkbox is selected (TRUE) then I want the answer in A1 to
be $10.50. If not checked (FALSE) I want the answer in A1to be $2.50. How
do I do this?

Thanks in advance!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default Check box macros

It would work something like this:

if checkbox1.value = true then
cell.(A1).value = $10.50
else
cell(A1).value = 2.50
end if

HTH
Thanks,
Roger
"Sunlover" wrote:

Hi there,

On a form if a checkbox is selected (TRUE) then I want the answer in A1 to
be $10.50. If not checked (FALSE) I want the answer in A1to be $2.50. How
do I do this?

Thanks in advance!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Check box macros

Hi Roger,

Thanks for the quick response. However, below is exactly what I entered,
but an error keeps popping up that says: Compile Error: Sub or Function not
defined1:

Private Sub CheckBox1_Click()

If CheckBox1.Value = True Then
cell(A1).Value = 10.5
Else
cell(A1).Value = 2.5
End If

End Sub

Any suggestions?

"Roger Converse" wrote:

It would work something like this:

if checkbox1.value = true then
cell.(A1).value = $10.50
else
cell(A1).value = 2.50
end if

HTH
Thanks,
Roger
"Sunlover" wrote:

Hi there,

On a form if a checkbox is selected (TRUE) then I want the answer in A1 to
be $10.50. If not checked (FALSE) I want the answer in A1to be $2.50. How
do I do this?

Thanks in advance!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Check box macros

Private Sub CheckBox1_Click()
If me.CheckBox1.Value = True Then
me.range("A1").Value = 10.5
Else
me.range("a1").Value = 2.5
End If
End Sub

I like to qualify the objects (both the checkbox and the range), but that wasn't
the real problem.

me.cells(1,1).value = 10.5

would have worked ok, too.


Sunlover wrote:

Hi Roger,

Thanks for the quick response. However, below is exactly what I entered,
but an error keeps popping up that says: Compile Error: Sub or Function not
defined1:

Private Sub CheckBox1_Click()

If CheckBox1.Value = True Then
cell(A1).Value = 10.5
Else
cell(A1).Value = 2.5
End If

End Sub

Any suggestions?

"Roger Converse" wrote:

It would work something like this:

if checkbox1.value = true then
cell.(A1).value = $10.50
else
cell(A1).value = 2.50
end if

HTH
Thanks,
Roger
"Sunlover" wrote:

Hi there,

On a form if a checkbox is selected (TRUE) then I want the answer in A1 to
be $10.50. If not checked (FALSE) I want the answer in A1to be $2.50. How
do I do this?

Thanks in advance!


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Check box macros

Dave,

You are amazing! Just what I was looking for :) Thanks so much!!!

"Dave Peterson" wrote:

Private Sub CheckBox1_Click()
If me.CheckBox1.Value = True Then
me.range("A1").Value = 10.5
Else
me.range("a1").Value = 2.5
End If
End Sub

I like to qualify the objects (both the checkbox and the range), but that wasn't
the real problem.

me.cells(1,1).value = 10.5

would have worked ok, too.


Sunlover wrote:

Hi Roger,

Thanks for the quick response. However, below is exactly what I entered,
but an error keeps popping up that says: Compile Error: Sub or Function not
defined1:

Private Sub CheckBox1_Click()

If CheckBox1.Value = True Then
cell(A1).Value = 10.5
Else
cell(A1).Value = 2.5
End If

End Sub

Any suggestions?

"Roger Converse" wrote:

It would work something like this:

if checkbox1.value = true then
cell.(A1).value = $10.50
else
cell(A1).value = 2.50
end if

HTH
Thanks,
Roger
"Sunlover" wrote:

Hi there,

On a form if a checkbox is selected (TRUE) then I want the answer in A1 to
be $10.50. If not checked (FALSE) I want the answer in A1to be $2.50. How
do I do this?

Thanks in advance!


--

Dave Peterson

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
Increase size of a Forms Check Box (click on to enter check mark) 718Satoshi Excel Discussion (Misc queries) 0 August 17th 07 01:52 AM
Check if Conditional Format is True or False / Check cell Color Kevin McCartney Excel Worksheet Functions 5 June 29th 07 11:12 AM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
I need help with macros and check boxes. Marc New Users to Excel 2 March 20th 06 04:20 PM
Macros to delete check boxes GWB Direct Excel Discussion (Misc queries) 23 June 3rd 05 09:56 PM


All times are GMT +1. The time now is 12:33 PM.

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

About Us

"It's about Microsoft Excel"