+ Reply to Thread
Results 1 to 11 of 11

How to: Macro to divide/multiply and show results

  1. #1
    Registered User
    Join Date
    11-11-2013
    Location
    hun
    MS-Off Ver
    Excel 2013
    Posts
    76

    Red face How to: Macro to divide/multiply and show results

    Hello.

    I know this one is an easy macro but im still a rookie and can't make it yet

    As you can see there are 2 buttons,
    what i want is to click "Cartons" so the macro will divide pcs/carton by Stock and display the result in the row: Stock
    The other button is the "Pieces" which i want to make to multiply pcs/carton with Stock and display in the row: Stock

    I would be really glad to have some help with this, fighting with excel for a long time now

    excelreqhelp.jpg

  2. #2
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: How to: Macro to divide/multiply and show results

    Try this...
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: How to: Macro to divide/multiply and show results

    @Viktor86HUN,

    Is there a need to create a macro, if you can add a column to store the type "P" for Piece and "C" for carton and then write a simple if formula to achieve what you want.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  4. #4
    Registered User
    Join Date
    11-11-2013
    Location
    hun
    MS-Off Ver
    Excel 2013
    Posts
    76

    Re: How to: Macro to divide/multiply and show results

    Hi.

    abduljaleel.mca

    Yes something like this but instead of displaying the result in a 3. column it should replace the numbers in the "Stock" column, and it should apply to all the rows in the xls.
    also i figured out another problem.

    there are 60pieces on stock this is the default value. if you click pieces again it multiplies it and the number is not accurate anymore.
    It should be like: 60 by default, and when clicking pieces. and 10 when i click carton because 60:6

    it looks even more complicated than i thought


    Xlbiznes i would use a formula, im not sure that i can attach formulas to a click of a button. is that possible?

  5. #5
    Registered User
    Join Date
    11-11-2013
    Location
    hun
    MS-Off Ver
    Excel 2013
    Posts
    76

    Re: How to: Macro to divide/multiply and show results

    So let me sum just to make it clear

    The cell in pieces should be 60. this is the stock in pieces, when i click the button: "Pieces" at this point it should not change because it would give a wrong stock.
    When i click the "Carton" button it should replace 60 with 6 because: 60:6, when i click pieces after this it should replace 6 with 60.


    Looks pretty hard for me, anyone can solve this please?

  6. #6
    Registered User
    Join Date
    11-11-2013
    Location
    hun
    MS-Off Ver
    Excel 2013
    Posts
    76

    Re: How to: Macro to divide/multiply and show results

    anyone?

  7. #7
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: How to: Macro to divide/multiply and show results

    @Viktor86HUN,

    If feel that a simple formula will do the job. Attached is my solution .

    Hope this helps.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-11-2013
    Location
    hun
    MS-Off Ver
    Excel 2013
    Posts
    76

    Re: How to: Macro to divide/multiply and show results

    yes it is very clever, my only problem is that i cannot add another column because the "Stock" column should show the pcs or cartons regarding what i choose, but the Stock cells are already a formula summerizing the incoming and outgoing goods.
    So it would be ideal for me to change the Stock column for a push of a button to represent Carton or Pieces.

    I really appretiate your help, it brings me closer to the solution but im still not there

  9. #9
    Registered User
    Join Date
    11-11-2013
    Location
    hun
    MS-Off Ver
    Excel 2013
    Posts
    76

    Re: How to: Macro to divide/multiply and show results

    anyone have an idea how to achieve this???
    Last edited by Viktor86HUN; 11-19-2013 at 11:14 AM.

  10. #10
    Registered User
    Join Date
    11-11-2013
    Location
    hun
    MS-Off Ver
    Excel 2013
    Posts
    76

    Re: How to: Macro to divide/multiply and show results

    So i guess it is impossible to make something like this in Excel.

  11. #11
    Registered User
    Join Date
    11-11-2013
    Location
    hun
    MS-Off Ver
    Excel 2013
    Posts
    76

    Re: How to: Macro to divide/multiply and show results

    still hunting for a solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Multiply, Divide and Then Multiply in a cell
    By Brownie2576 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-22-2012, 08:57 PM
  2. [SOLVED] =Sum help add divide and multiply (Excel 2003)
    By Excelnoub in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-24-2012, 12:41 PM
  3. Can I use the IF function to multiply and divide?
    By carolan78 in forum Excel General
    Replies: 8
    Last Post: 09-11-2008, 09:50 AM
  4. add, multiply then divide
    By Zetman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-23-2006, 10:45 PM
  5. how do I divide or multiply an entire column?
    By 1number in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-05-2005, 05:07 PM

Tags for this Thread

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