+ Reply to Thread
Results 1 to 22 of 22

Need to return trimmed result

  1. #1
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Need to return trimmed result

    I need a macro that will take the numbers in column D and remove the first 2 zeros and the last 3 characters and return value in cell C.

    Office 365.
    Attached Files Attached Files
    Last edited by myerays; 08-01-2021 at 10:00 AM. Reason: Office Version

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,728

    Re: Need to return trimmed result

    Could be done with a formula:

    =TEXT(MID(D7,3,10),"0000000000")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,540

    Re: Need to return trimmed result

    Or
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Pepe Le Mokko; 08-01-2021 at 10:19 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,728

    Re: Need to return trimmed result

    Office 365.
    Please update your forum profile from 2016.

  5. #5
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Need to return trimmed result

    Thank you for your input

    I want a macro not a formula I know this will work but I would like a macro that would loop through d column and return the result into column C


  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,728

    Re: Need to return trimmed result

    No worries, but please update your profile as requested.

    What is the difference between a macro returning results in column C and a formula returning the same results? You do know that you can drag copy the formula down, don't you?

  7. #7
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Need to return trimmed result

    Yes I do, But my friend that uses the same sheet is not excel savy so I need to smart it up so it will be dumbed down so to speak.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,728

    Re: Need to return trimmed result

    Fair enough.

  9. #9
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Need to return trimmed result

    Thank you so much.
    Last edited by AliGW; 08-01-2021 at 10:49 AM. Reason: PLEASE don't quote unnecessarily!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,728

    Re: Need to return trimmed result

    You should not PM members pestering for help - don't do that again.

    Post your code here for one of our VBA experts to look at.

  11. #11
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Need to return trimmed result

    Thank you so much I appreciate that so I will not do it again.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,728

    Re: Need to return trimmed result

    Post the code you sent to me here.

  13. #13
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Need to return trimmed result

    This is the macro that I have, it removes the last 3 characters and I would like it to remove the first 2 characters as well and return the value in column C and leave the original value in column D. Any help would be appreciated.

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Need to return trimmed result

    Did I do it right.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,728

    Re: Need to return trimmed result

    Yes.

    Administrative Note:

    It is the weekend. Please remember that those who help here do so voluntarily and of their own goodwill. They live in many different time zones and many will be out at work right now if they are not asleep on the other side of the globe. Please do not try to put pressure of time on anyone here: if you get the help you need today, that's fine, but you really should not count on it. Thanks for your understanding and patience.

  16. #16
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Need to return trimmed result

    Thank you for your direction and help. I work a lot as well and this is the only day I have off. I love using excel, I have always said if you think it, it can be done. My problem is I a beginner when it comes to VBA I had some macros that worked in MS 16 but when it changed to MS 365 new VBA they stopped working.

    So I really do appreciate any help anyone gives me. Thank you so much.
    Last edited by AliGW; 08-01-2021 at 11:24 AM. Reason: PLEASE don't quote unnecessarily!

  17. #17
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Need to return trimmed result

    Maybe :
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  18. #18
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Need to return trimmed result

    Thank you as it works and replaces the cell value, How can I make it put the value in the cell before it and leave the original value in the original cell?

    Thank you so much
    Last edited by AliGW; 08-01-2021 at 11:51 AM. Reason: PLEASE stop quoting unnecessarily!

  19. #19
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Need to return trimmed result

    You are welcome.
    Add the .offset(, -1) part to the code :
    Please Login or Register  to view this content.

  20. #20
    Registered User
    Join Date
    10-31-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    18

    Re: Need to return trimmed result

    Works great Thank you
    Last edited by AliGW; 08-01-2021 at 12:02 PM. Reason: PLEASE stop quoting unnecessarily!

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,728

    Re: Need to return trimmed result

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

    Administrative Note:

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below or the REPLY button instead of REPLY WITH QUOTE.

  22. #22
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Need to return trimmed result

    You are welcome, glad to help.

    Regards

+ 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] Need code trimmed down
    By Butcher1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-02-2020, 12:26 PM
  2. Return the earliest result and latest result with criteria
    By PFDave in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 04-26-2016, 07:20 AM
  3. Getting a Vlookup to return a 'trimmed' value
    By TomP1988 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-22-2014, 05:39 AM
  4. Trimmed mean doesn't give expected result
    By Winton in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-03-2012, 06:31 AM
  5. [SOLVED] excel result return wrong calcuation result
    By garyww in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-14-2006, 06:20 AM
  6. [SOLVED] Advanced formula - Return result & Show Cell Reference of result
    By Irv in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-05-2006, 10:40 PM
  7. Trim and Keep the Trimmed Data
    By sally t in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM

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