+ Reply to Thread
Results 1 to 8 of 8

Converting simple multiplication formula in VBA code

  1. #1
    Registered User
    Join Date
    11-17-2010
    Location
    India
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    83

    Converting simple multiplication formula in VBA code

    Friends,

    I need a macro coding where i need to multiply the values entered in col G and Col M should get multiplied and reflect the result in column O.

    I tried to do this in VBA coding but unfortunately i could not make it...Here is my code.

    Can anyone help me to modify it.

    Please Login or Register  to view this content.
    Last edited by Saky; 12-07-2010 at 07:56 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,218

    Re: Converting simple multiplication formula in VBA code

    Try this
    Please Login or Register  to view this content.

    Hope this helps
    Last edited by Marcol; 12-06-2010 at 09:36 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    11-17-2010
    Location
    India
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    83

    Re: Converting simple multiplication formula in VBA code

    Quote Originally Posted by Marcol View Post
    Try this
    Please Login or Register  to view this content.

    Hope this helps
    Thank you Marcol!!! This code works great.

    Adding to that i need a result in col Q where it should divide the value in Column O by 540*60. I need the result without decimals hence i have added Round function.

    The below code works fine, but the issue is this coding works only if there is any action in col O. How can i solve this issue.

    I want the result to reflect automatically as it is reflecting in Col O. If it cannot be able to work automatically can it be done by clicking the cell(click event)..just a suggestion from my end...

    Kindly help...

    Please Login or Register  to view this content.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,218

    Re: Converting simple multiplication formula in VBA code

    This should work as you ask
    Please Login or Register  to view this content.

    There seems to be nothing wrong with your additional code, just remember that the result in Column O has to be about 19440 to get a result of 1 in Column Q when you use round to zero decimal places.

    What is the context of this?
    What are you trying to do is it something to do with times?

  5. #5
    Registered User
    Join Date
    11-17-2010
    Location
    India
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    83

    Re: Converting simple multiplication formula in VBA code

    Marcol,

    As you said the additional code works fine..But the problem is

    Only after pressing F2 in col O3 only then i am getting the result in Q3.

    So this macro is starting its function only when any action is performed in the targeted cell.

    I am asking without doing that action can i get the result automatically in Column Q.

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,218

    Re: Converting simple multiplication formula in VBA code

    Try this, Column O will update when either Column G or M is changed for that particular row
    Please Login or Register  to view this content.

    Is that what you are after?

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,218

    Re: Converting simple multiplication formula in VBA code

    Why do you need vba for this?

    in Column O
    Please Login or Register  to view this content.
    Drag/Fill Down

    in Column Q
    Please Login or Register  to view this content.
    Drag/Fill Down

  8. #8
    Registered User
    Join Date
    11-17-2010
    Location
    India
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    83

    Re: Converting simple multiplication formula in VBA code

    Marcol,

    Thank you so much for your assistance. With some more tweaking in the macro code you have provided i got the result what i expected. Thanks again...

+ 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