+ Reply to Thread
Results 1 to 6 of 6

Thread: formula to code

  1. #1
    Registered User
    Join Date
    02-09-2012
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    3

    formula to code

    I have to use foll formula very often on particular data.
    Data:--
    TIN NO. 22523300218
    TIN NO. 22523300218
    B/CST/1490 DT 13/01/99
    B/CST/1490 DT 13/01/99
    2252335588
    457896321V 13/01/12


    I use formula to extract nos. from it:
    LOOKUP(99^99,--("0"&MID(REPLACE(A1,SEARCH("/??/",A1&"/~~/")-2,10,""),MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},REPLACE(A1&" ",SEARCH("/??/",A1&"/~~/")-2,10,"")&"0123456789")),ROW($1:$80))))

    Actually i dnt need A1 because i can use it anywhere in sheet in any workbook.
    I think to make user defined function named Extract so that i can use it always i need.
    Thanks for help!!!

    http://www.mrexcel.com/forum/showthr...=1#post3035999
    Last edited by VRA; 02-10-2012 at 08:19 AM. Reason: cross posted

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: formula to code

    You can define a name for a complex formula

    Go to Insert>Name>Define and in the "Names in workbook" box type: a name for the formula e.g. MyFormula
    Now click in the "Refers to" box and type or paste your formula then click Add.

    In a cell type =MyFormula

    Here's a fuller explanation
    Last edited by royUK; 02-09-2012 at 08:28 AM.
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  3. #3
    Registered User
    Join Date
    02-09-2012
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: formula to code

    THANKS FOR EARLY & GOOD REPLY.
    jUST WANTED TO ASK 1) CAN I USE IT IN EVRY WORKBOOK ?
    2) Do my data i.e alphanumeric data be placed in Column A only?

  4. #4
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: formula to code

    I'm sure that the formula will only work in the workbook that holds the Name

    Thanks for the rep.
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  5. #5
    Registered User
    Join Date
    02-09-2012
    Location
    INDIA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: formula to code

    Any suggestions to use in all workbooks.?

  6. #6
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: formula to code

    Cross post here.
    Good luck.

+ 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.2.0