D
dave bryden
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
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