+ Reply to Thread
Results 1 to 7 of 7

Create custom function to multiply numeric values!?

  1. #1
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2007, 2010, 2019
    Posts
    37

    Create custom function to multiply numeric values!?

    I have some files in which there is a column where there are string data like

    column C
    abc10po2x33
    m20xpx12zo1
    qw45x39x12
    ...etc

    I'm trying to get the product of the 2nd and 3rd numeric values using a custom function.
    I've tried
    Please Login or Register  to view this content.
    Wished results are(in bold):

    66 i.e.(2*33)
    12 i.e.(12*1)
    468 i.e.(39*12)
    ...etc

    But the code is not working, please help.

    Also, how do I use this function in any of my excel file and not a particular file?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    16,516

    Re: Create custom function to multiply numeric values!?

    I was able to achieve this using Power Query/Get and Transform which is available to you as it was added as an add in to 2010. Here is the Mcode and the file

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2007, 2010, 2019
    Posts
    37

    Re: Create custom function to multiply numeric values!?

    Hi Alan, can you tell me how to do this in excel 2007?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2019 (Win 10 - Work) & 365 Subscription Insider (Win 10 - Home)
    Posts
    34,190

    Re: Create custom function to multiply numeric values!?

    Your forum profile says 2010, which supports PowerQuery - 2007 does not. You should have mentioned this or changed your forum profile before posting. YOu will need to wait for someone to offer an alternative solution.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    8,552

    Re: Create custom function to multiply numeric values!?

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  6. #6
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2007, 2010, 2019
    Posts
    37

    Re: Create custom function to multiply numeric values!?

    Thanks AlphaFrog

    BTW, how can I make this function available for any excel file that I work with ?

    Also, do you mind explaining your code a bit ?

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    16,516

    Re: Create custom function to multiply numeric values!?

    BTW, how can I make this function available for any excel file that I work with ?
    Save it in your Personal.xlsb file. If you don't have one, then .....

    https://www.rondebruin.nl/win/personal.htm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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