Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Location
    Vancouver, Br. Columbia
    Posts
    223
    Thanks
    0
    Thanked 0 Times in 0 Posts

    using a check box to add a sheet (excel 03)

    Hi,

    I have a macro which I am having trouble with.
    i have attached the code

    at the line vPrintSheets = Array("Title Page", "Procedure", "Proppant Schedule", "Pricing", "Calc Page"&fsheet&("T & C")
    there is a varible which refers to the check box. all i want to do is if the checkbox value is true to add the sheet to the printing list. I am wondering what do i need to change in my code?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: using a check box to add a sheet (excel 03)

    Use something like

    If printfracsheet.Value = True Then
    vPrintSheets = ... ' include extra sheet
    Else
    vPrintSheets = ... ' exclude extra sheet
    End If

  3. #3
    2 Star Lounger
    Join Date
    May 2005
    Location
    Vancouver, Br. Columbia
    Posts
    223
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using a check box to add a sheet (excel 03)

    ok thank you,

    do i have to call the checkbox object if i am doing the code in a module and not behinnd the worksheet?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: using a check box to add a sheet (excel 03)

    What do you mean by "call the checkbox object"?

  5. #5
    2 Star Lounger
    Join Date
    May 2005
    Location
    Vancouver, Br. Columbia
    Posts
    223
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using a check box to add a sheet (excel 03)

    What i mean is will my code beable to know what checkbox i am talking about with out declaring anything?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: using a check box to add a sheet (excel 03)

    Most code is not clairvoyant.

    What kind of check box is this? Did you create it from the Forms toolbar or from the Control Toolbox?

  7. #7
    2 Star Lounger
    Join Date
    May 2005
    Location
    Vancouver, Br. Columbia
    Posts
    223
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using a check box to add a sheet (excel 03)

    Control Tool Box menu

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: using a check box to add a sheet (excel 03)

    You can use code in the worksheet module, or in a standard module, whichever is most convenient. For a check box named CheckBox1 on a sheet named Sheet4, you can use Me.CheckBox1 in the worksheet module for Sheet4, or Worksheets("Sheet4").CheckBox1 in a standard module.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •