+ Reply to Thread
Results 1 to 8 of 8

macro for change number between ()

  1. #1
    Forum Contributor
    Join Date
    01-29-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    434

    macro for change number between ()

    hello experts

    we got may time solution with this forum once again we face a problem and i came here for soultion. hope we also get this time

    We have a very large road recrod in this record in colum D we have follwing type data

    1
    2
    3(200)
    3(200)
    3(600)
    4
    5
    6(100)
    6(900)
    .
    .
    .


    we want convert this data in follwing type

    1
    2
    3-1
    3-2
    3-3
    4
    5
    6-1
    6-2


    actually where matter in between () those cell change () text to start no - 1 or 2 or 3

    we attach sample file for ur kind perusal




    thanks in advance

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: macro for change number between ()

    Something like below?

    I assumed that you wanted to replace existing values in range and that you had header row and data started at Row2.
    Please Login or Register  to view this content.
    Last edited by CK76; 02-03-2017 at 04:23 PM.

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: macro for change number between ()

    Hmm, come to think of it. Why did I put it in dictionary...?

    Amended code.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-29-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    434

    Re: macro for change number between ()

    hi sir first thanks for ur responce

    its work fine but a place its not work as per my need we attach a sheet where we mention what we want output in show colum S

    in row 60 and 61 here not result
    15-1
    15-2
    16-3
    16-4

    but we want
    16-1
    16-2
    Attached Files Attached Files
    Last edited by santosh226001; 02-03-2017 at 04:39 PM.

  5. #5
    Forum Contributor
    Join Date
    01-29-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    434

    Re: macro for change number between ()

    Attachemtn is here
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-29-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    434

    Re: macro for change number between ()

    sir don't know what happen today with my end .. one thred post 2 time and now attachment not attached...

    sir my attachment is another my thred with same name... (don't know how's today post 2 thread same name..sorry for this we are trying to attach file here but not attached}
    Attached Files Attached Files
    Last edited by santosh226001; 02-03-2017 at 04:45 PM.

  7. #7
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: macro for change number between ()

    Ok, so there are instances where there's no break between (). In that case, try below.
    It can probably optimized a bit more, but should do what's been asked.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    01-29-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    434

    Re: macro for change number between ()

    Yes!! this works as per my need thank for ur help

    We add rep for ur this valuable help..

    Thanks a lot

+ 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. macro to change a number and its format
    By Emma_B in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2014, 02:46 PM
  2. [SOLVED] Using a macro to change number of decimal
    By Tmc2159 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2013, 03:07 PM
  3. Change macro from text to number
    By hazzaska in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2013, 04:13 PM
  4. change a number by 1 value within macro
    By yrndtn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2011, 10:20 AM
  5. Macro to change % into number
    By Jessica.Bush in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2010, 08:48 AM
  6. Need help with a macro that will change digits in a number.
    By drevil7171 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2006, 11:45 PM
  7. Macro to change row number within formula
    By mpot4 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2005, 11:05 PM

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