+ Reply to Thread
Results 1 to 3 of 3

Making a macro run automatically

  1. #1
    Registered User
    Join Date
    01-14-2009
    Location
    Kent,England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Making a macro run automatically

    Hi

    I hope someone can help me.

    I have created a order form in excell which is attatched. I have also created a macro that will calculate the price of postage.

    What I would like to do is to have a drop down box that in the postage row that says yes or no. If no is selected then the total for post should be 0 however if yes is selected and the total is over £30.00 then £3.50 should be added. If yes is selected and the order is under £30.00 then £1.50 should be added.

    I have managed to do this but only by having a button that when pressed runs the macro. Idealy I would like the macro to be running constantly. I tried to do this on a timer but i got error messages.

    However I also thought about trying to get it to run when a certain cell is clicked. Is this possible?

    Thanks in advance

    Edd
    Attached Files Attached Files

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Making a macro run automatically

    Place this code into the module for sheet1.

    When postage option is selectedin cell C31 it will automatically place postage amount in cell E31; 3.50, 1.50 or 0.

    You need to add a SUM formula in cell E32 for the code to work.

    formula: =SUM(E25:E31)

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Making a macro run automatically

    Macro makes sense, but if you send an inexperienced user a macro-enabled workbook they may be troubled by the messages that come up. Plus, some firewalls block downloads of xlsm files (mine included). Further (again) a macro like this will break Excel's native Undo functionality. Finally, this could be solved far quicker anyway with a simple equation:
    E31=IF(C31="","",IF(C31="no",0,LOOKUP(E32,{0,30},{1.5,3.5})))
    (guessed references without being able to see workbook; upload .xls if you want further input).

    CC

+ 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