+ Reply to Thread
Results 1 to 5 of 5

Using checkboxes to determine what data to carry over

  1. #1
    Registered User
    Join Date
    03-10-2004
    Posts
    45

    Using checkboxes to determine what data to carry over

    I have 26 checkboxes that can vary on how many could or would be selected. It could be just 1 or it could be all 26. The checkboxes are not in a dialog box but hovered along side of a cell within a worksheet(Main). I do not know how to get the checkbox involved in my code if true or false. I need the information in the cell its aligned to, to become part of my data carry over. I am pasting just one of many data carry over queries in here so that you can see how it may or may not fit in.
    Thanx
    Michael

    With Worksheets("All PCE")
    Set rng = .Range(.Cells(1, 13), .Cells(Rows.Count, 1).End(xlUp))
    End With
    ' VISIN1 Metallic
    rw = 0
    Set rng1 = Worksheets("VISIN1-M").Range("A2")
    For Each cell In rng
    DateRange

    If IsDate(cell.Value) Then
    If CDate(cell.Value) >= ChDate And CDate(cell.Value) <= ChDate2 Then
    If cell.Offset(0, 3).Value = "VISIN1" Then
    If cell.Offset(0, -8).Value <> "P74" _
    And cell.Offset(0, -8).Value <> "P02" _
    And cell.Offset(0, -8).Value <> "P08" _
    And cell.Offset(0, -8).Value <> "P01" Then
    rw = rw + 1
    cell.Offset(0, -9).Resize(1, 25).Copy Destination:=rng1(rw)

    End If
    End If
    End If
    End If

    Next cell

  2. #2
    Tom Ogilvy
    Guest

    Re: Using checkboxes to determine what data to carry over

    If you named your checkboxes to correspond to the row such as cbox29
    then
    set cb = Worksheets("All PCE").OleObjects("cbox" & cell.row).Object
    if cb.Vaue then

    --
    Regards,
    Tom Ogilvy

    "Michael Wise" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I have 26 checkboxes that can vary on how many could or would be
    > selected. It could be just 1 or it could be all 26. The checkboxes are
    > not in a dialog box but hovered along side of a cell within a
    > worksheet(Main). I do not know how to get the checkbox involved in my
    > code if true or false. I need the information in the cell its aligned
    > to, to become part of my data carry over. I am pasting just one of many
    > data carry over queries in here so that you can see how it may or may
    > not fit in.
    > Thanx
    > Michael
    >
    > With Worksheets("All PCE")
    > Set rng = .Range(.Cells(1, 13), .Cells(Rows.Count, 1).End(xlUp))
    > End With
    > ' VISIN1 Metallic
    > rw = 0
    > Set rng1 = Worksheets("VISIN1-M").Range("A2")
    > For Each cell In rng
    > DateRange
    >
    > If IsDate(cell.Value) Then
    > If CDate(cell.Value) >= ChDate And CDate(cell.Value) <= ChDate2 Then
    > If cell.Offset(0, 3).Value = "VISIN1" Then
    > If cell.Offset(0, -8).Value <> "P74" _
    > And cell.Offset(0, -8).Value <> "P02" _
    > And cell.Offset(0, -8).Value <> "P08" _
    > And cell.Offset(0, -8).Value <> "P01" Then
    > rw = rw + 1
    > cell.Offset(0, -9).Resize(1, 25).Copy Destination:=rng1(rw)
    >
    > End If
    > End If
    > End If
    > End If
    >
    > Next cell
    >
    >
    > --
    > Michael Wise
    > ------------------------------------------------------------------------
    > Michael Wise's Profile:

    http://www.excelforum.com/member.php...fo&userid=6998
    > View this thread: http://www.excelforum.com/showthread...hreadid=391280
    >




  3. #3
    Registered User
    Join Date
    03-10-2004
    Posts
    45

    hmmm

    Tom,

    Well I guess I do not follow on this one. I'm not clear as to why my checkboxes would represent the cell.row. I can say I'm using cells B3:B15 and C3:C15 to contain text data on worksheet("Main"). The checkboxes are basically hovering to one side of the text. My goal is that any one or more of the check boxes are checked (true) then it will use the text in that cell as a part of the criteria that has to be met before being carried over. I may just be using what you gave me in the wrong spot but i'm trying it where it make sense to me at this point. The data that is being used to compare and transfer is on worksheet("All PCE"). I appologize if what you've given is actually correct to begin with.

    Michael

  4. #4
    Tom Ogilvy
    Guest

    Re: Using checkboxes to determine what data to carry over

    Your looping over all cells in Sheet All PCE (Columns A to M of the filled
    rows starting in row 1) and making decisions on data offset from each cell.
    (same row).

    Your code makes no mention of a sheet named MAIN and you certainly have
    given no insight into how 13 (or is it 26) checkboxes on MAIN would relate
    to conditions on each individual row in ALL PCE.

    Hovering to the side is not particularly descriptive - are there checkboxes
    in columns A and D, just D, just A

    How do your checkboxes participate in the decision to copy each row?


    --
    Regards,
    Tom Ogilvy



    "Michael Wise" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Tom,
    >
    > Well I guess I do not follow on this one. I'm not clear as to why my
    > checkboxes would represent the cell.row. I can say I'm using cells
    > B3:B15 and C3:C15 to contain text data on worksheet("Main"). The
    > checkboxes are basically hovering to one side of the text. My goal is
    > that any one or more of the check boxes are checked (true) then it will
    > use the text in that cell as a part of the criteria that has to be met
    > before being carried over. I may just be using what you gave me in the
    > wrong spot but i'm trying it where it make sense to me at this point.
    > The data that is being used to compare and transfer is on
    > worksheet("All PCE"). I appologize if what you've given is actually
    > correct to begin with.
    >
    > Michael
    >
    >
    > --
    > Michael Wise
    > ------------------------------------------------------------------------
    > Michael Wise's Profile:

    http://www.excelforum.com/member.php...fo&userid=6998
    > View this thread: http://www.excelforum.com/showthread...hreadid=391280
    >




  5. #5
    Registered User
    Join Date
    03-10-2004
    Posts
    45
    Your looping over all cells in Sheet All PCE (Columns A to M of the filled
    rows starting in row 1) and making decisions on data offset from each cell.
    (same row).

    Correct.

    Your code makes no mention of a sheet named MAIN and you certainly have
    given no insight into how 13 (or is it 26) checkboxes on MAIN would relate
    to conditions on each individual row in ALL PCE.

    There are in fact 26 checkboxes on MAIN which reside's outside of any current association to what is currently coded. The text that resides in Cells B3:B15 and C3:c15 on (Main) are within one of the cells in each row on ("All PCE").

    Hovering to the side is not particularly descriptive - are there checkboxes
    in columns A and D, just D, just A

    The checkboxes are located in column B and C but they are not linked in any way I can select them and move them where I like.

    How do your checkboxes participate in the decision to copy each row?

    At this point my checkboxes do not participate at all. That is where i'm having the trouble. I'm totally unaware how to associate the checkbox to the cell and then get it to relate within the ("All PCE") worksheet code.


    I'm sure after reading all this your thinking HUH? Because of the way i've gone about it. I would zip it but the file comes up to big still.

    Michael

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1