Results 1 to 9 of 9

Multiple checkboxes, automated/incremental code possible?

Threaded View

mewingkitty Multiple checkboxes,... 03-17-2009, 03:44 PM
Leith Ross Re: Multiple checkboxes,... 03-17-2009, 05:29 PM
mewingkitty Re: Multiple checkboxes,... 03-17-2009, 05:38 PM
Leith Ross Re: Multiple checkboxes,... 03-17-2009, 08:01 PM
Leith Ross Re: Multiple checkboxes,... 03-17-2009, 08:31 PM
  1. #1
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Multiple checkboxes, automated/incremental code possible?

    Private Sub CheckBox1_Change()
    z = 1
    If CheckBox1 = True Then
        Do While Not Worksheets("Generated order").Cells(z, 1) = vbNullString
        z = z + 1
        Loop
        Worksheets("Generated order").Cells(z, 1) = Cells(4, 1)
    End If
    z = 1
    If CheckBox1 = False Then
        Do While Not Cells(4, 1) = Worksheets("Generated order").Cells(z, 1)
        z = z + 1
        Loop
        Worksheets("Generated order").Rows(z).Delete
    End If
    End Sub
    Private Sub CheckBox2_Change()
    z = 1
    If CheckBox2 = True Then
        Do While Not Worksheets("Generated order").Cells(z, 1) = vbNullString
        z = z + 1
        Loop
        Worksheets("Generated order").Cells(z, 1) = Cells(5, 1)
    End If
    z = 1
    If CheckBox2 = False Then
        Do While Not Cells(5, 1) = Worksheets("Generated order").Cells(z, 1)
        z = z + 1
        Loop
        Worksheets("Generated order").Rows(z).Delete
    End If
    End Sub
    Private Sub CheckBox3_Change()
    z = 1
    If CheckBox3 = True Then
        Do While Not Worksheets("Generated order").Cells(z, 1) = vbNullString
        z = z + 1
        Loop
        Worksheets("Generated order").Cells(z, 1) = Cells(6, 1)
    End If
    z = 1
    If CheckBox3 = False Then
        Do While Not Cells(6, 1) = Worksheets("Generated order").Cells(z, 1)
        z = z + 1
        Loop
        Worksheets("Generated order").Rows(z).Delete
    End If
    End Sub


    Heya,
    Wondering if a guy was going to have a list of say, 1k or so worth of checkboxes, with incremental code such as this, if there's a way to simply write one section which states kinda - for each checkbox, do this with the corresponding row... Since otherwise I'd need 10k work of lines of code, which makes me assume there's a way around this.

    mew!
    Last edited by mewingkitty; 03-18-2009 at 03:10 PM.
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

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