+ Reply to Thread
Results 1 to 8 of 8

Linking macros to items in a drop down list

  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Linking macros to items in a drop down list

    HI,

    I have a quote file, in Excel, with a drop down list (created through Data Validation) with the names of different companies. For each company, I need to charge different amounts of tax. I tried to set up macros first before I did anything but they didnt seem to work.

    Here is a better understanding:

    For Company A - we dont charge tax
    Company B - we dont charge tax
    Company C - We charge 5% Fee and 5% Overhead (Five rows need to be added to show this)
    Company D - We dont charge tax
    Company E - We charge only 5% GST (1 row will need to be added)

    I have a general format for the companies that we do not charge tax but when I go to set up my macros to change the format for the other companies they do not work.

    PLEASE can someone help me set up the macros for each company and then link them to that company when they are chosen from the drop down list....?

    PLEASE HELP ME!!! I am pretty familiar with Excel and Macros but now that they are not working I do not know what to do...? VBA code is not my favourite.

    HELP!

  2. #2
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Linking macros to items in a drop down list

    Hello cweicker
    You don't give any info about your data layout or what you want your macros to do etc. so its impossible to be too specific.
    The attached will give you a general structure to link your dropdown values to VBA.
    I have just used a message box to test so you will need to replace this with your functional code.
    Attached Files Attached Files
    If this was helpful then please click the small star icon at the bottom left of my post. A little appreciation goes a long way.

  3. #3
    Registered User
    Join Date
    01-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Linking macros to items in a drop down list

    Oh sorry!

    What you provided is exactly what I have and then there is an area for a quote description with a column for price. At the bottom of that there is the subtotal. So for each company as said above, I need the macro to add or delete rows... but when I created my macros they didnt work. I just recorded them manually, like I said before I am not the greatest at VBA code and stuff like that.. so help!! lol

  4. #4
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Linking macros to items in a drop down list

    Please upload a worksheet with your before and after data/layouts

  5. #5
    Registered User
    Join Date
    01-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Linking macros to items in a drop down list

    Here is before....
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Linking macros to items in a drop down list

    Here is after for Company C
    BTW - the first file is what Company A, B, and D are to look like
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Linking macros to items in a drop down list

    And here is for Company E
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Linking macros to items in a drop down list

    hi cweicker, option to make it. Change value in A8 cell of Quote sheet. There is a hidden protected template sheet. To show this sheet run code "show_template_sheet" or "hide_template_sheet" to hide it. The sheet is protected to avoid occassional changes. Pasword is 123
    Attached Files Attached Files

+ 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