+ Reply to Thread
Results 1 to 3 of 3

Extract Zip Code but only first 5

  1. #1
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Extract Zip Code but only first 5

    I'm given data where address below is in one cell. Col G
    Most addresses only have the 5 digit Zip
    I need to extract the zip but only the first 5 for those that have Zip+
    The formula works great except for these
    How can I edit my formula?

    123 Road Trl - Courtland VA, 23837-1048
    456 Some Road - Chesapeake VA, 23320-1602
    =TRIM(RIGHT(SUBSTITUTE(G3," ",REPT(" ",255)),255))*1

    The code then compares to a Zip data list for other detail.
    Thanks
    Jim

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Extract Zip Code but only first 5

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Extract Zip Code but only first 5

    Thank you!!!!
    Works perfect
    I'll need to take some time and digest how you did this - really good!

+ 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. Extract web address from code
    By chisox721 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-05-2016, 05:59 AM
  2. [SOLVED] Extract top ten using code
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 12-27-2015, 09:14 AM
  3. [SOLVED] VB Code to extract part of name
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-09-2015, 12:21 PM
  4. Replies: 3
    Last Post: 12-18-2014, 10:27 AM
  5. [SOLVED] Extract data by code
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-12-2014, 03:20 AM
  6. Using VBA code to extract web data
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-07-2013, 08:00 AM
  7. Extract last name into a variable using VBA code
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-22-2006, 04:15 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