LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default using Sub's with checkboxs


Hi,
I'm fairly new to this type of programming and I was hoping
someone could clarify where I'm going wrong.

What I'm trying to do is this:

on sheet 1 I have put in a checkbox from the control bar. When the box
is ticked, I would like to propogate that tick to 2 other sheets. At
the moment the cells on the other 2 sheets are also checkboxes, mainly
cause I don't have this working.

I've gone thru the help, and have pulled several examples from this
group, however I still don't have it working and I think I have a
basic underlying misunderstanding.

this is what I've done:

on sheet 1, use the control bar to define a checkbox. I then named the
object. So my checkbox might be checkbox217, I've then named it box1.
select the cell and then gone into design mode and selected view code.

this brings up the pane to show that this code belongs to this
worksheet, and in the edit window I have
sub checkbox217_click ()
with box1
If .Value = True Then
ActiveSheet.Range("sheet1!$a$3").Value = 10
Else
ActiveSheet.Range("sheet1!$a$3") = ""
End If
End With
end sub

To get this going, I've simplified this so that if the box is ticked,
I put the value 10 in cell A3

when I run this I get an error saying object required.

Could someone perhaps help me understand what I'm doing wrong here?

1) when I go to the macro screen, I see sub checkbox217_click (), The
checkbox217 was assigned when I defined the checkbox, I named that box
to be box1, should I use box1 in this line?

2) when is the "With box1" required. is that to establish a
relationship between the name I have given the cell and the name that
was given by Excel when I defined it? Is the BOX1 then to be used
within the macro to reference the cell?

3) How do I reference that cell? I've seen examples where they use
just .value = True, I seen checkbox1.value = True, I've seen examples
where Activesheet is used. I don't have a clear understanding of which
format is to be used when.

4) Would it be better to have the cells on the "destination" sheets
defined as text fields rather than as a controlbar checkbox?
On my first sheet I have a list of aircraft, some will be active, some
will be inactive. on the first sheet, I tick the box when an aircraft
becomes active. I want the macro to tick a corresponding box on the
current status page, and also tick the corresponding box on the flight
following page.

Could someone help point me in the correct direction please?

many thanks
Dave


 
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
checkboxs Robin Excel Discussion (Misc queries) 12 August 10th 09 01:31 PM
checkboxs. Robin Excel Discussion (Misc queries) 0 June 1st 09 10:11 PM
Checkboxs Move in Document Sherry Excel Discussion (Misc queries) 1 November 22nd 05 08:13 PM
VB how to connect two sub's Christof[_5_] Excel Programming 2 November 11th 03 07:13 AM


All times are GMT +1. The time now is 08:34 AM.

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"