Results 1 to 7 of 7

Macro to run multiple checkboxes

Threaded View

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    5

    Macro to run multiple checkboxes

    I need your assistance on writing my checkbox macro(s) in Excel 2007.

    I have a workbook that imports a spreadsheet, manipulates the spreadsheet based upon the user’s requirements and then saves spreadsheet as a different name. That spreadsheet then in turn is uploaded into a database and prints the information that is contained in the spreadsheet.

    In the example that I have provided, I have listed five checkboxes, but ultimately there will be approximately thirty checkboxes. There may be anywhere between 3,500 to 7,500 rows of data in the spreadsheet. My checkboxes are currently the ActiveX checkbox.

    I want the user to either check or not check each option. The macro will then modify the character string in the cell(s) depending upon whether the checkbox was checked or not checked.

    My problem is that I cannot get my macro to run and update the cells appropriately using the checkbox. In addition, my current process may not be efficient but I wasn’t sure how else to perform the task.

    I have uploaded the macro and the data spreadsheet. Any input or guidance would be tremendously appreciated.

    I have also provided a copy of my code for my checkbox.
    Sub CheckBox1_click()
        With Sheets("Sheet1")
            If CheckBox1 = True Then
                Cells.Replace _
                    What:="351 / 353 DWW", Replacement:="Domestic Part", _
                    LookAt:=xlWhole, MatchCase:=False
            Else
                Cells.Replace _
                    What:="351 / 353 DWW", Replacement:="1", _
                    LookAt:=xlWhole, MatchCase:=False
                    End If
        End With
    End Sub
    Attached Files Attached Files
    Last edited by Leith Ross; 08-17-2012 at 02:48 PM. Reason: Added Code Tags

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