Results 1 to 7 of 7

Matching State City Zip Code Pattern before transposing to corresponding cell

Threaded View

  1. #1
    Registered User
    Join Date
    08-23-2014
    Location
    Miami, USA
    MS-Off Ver
    365
    Posts
    69

    Unhappy Matching State City Zip Code Pattern before transposing to corresponding cell

    I have a bunch of contacts listed in column B which I´m transposing to a specific cells according to their data. I need to write VBA code that will always transpose the row that contains the CITY STATE ZIP CODE information to the corresponding cell.
    This is part of my code that I have:

    If Rng.Areas(Grp).Cells(Itm) Like "*[a-z],*[A-Z][A-Z]*#####*" Then ……

    This works fine if the row contains: Lynchburg, VA 24503

    But I also have a row that has: Karen C. Metz, NMLS #223664 and will accidentally place this data under the wrong cell value. It might also just have the City and State but no zip code: Lynchburg, VA

    I think the key part is having the VBA code identify the two capital letters of the State within the string and then identify this row as the CITY value before transposing it to the appropriate column. I think this is the way to go because my data will always have the two letter state code.

    I’ve attached my current code to see what I’m talking about, please help, I’m a newbie to VBA so my current code is not the best. Any suggestions or a better way to do this will be greatly appreciated.
    Thanks
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. autofill city and state when typing in zip code
    By shughes6288 in forum Excel General
    Replies: 7
    Last Post: 01-07-2016, 12:35 PM
  2. Parsing City State and Zip Code
    By sandy1977 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-27-2014, 11:58 AM
  3. zip code to city, state function
    By xip in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-07-2012, 10:12 PM
  4. zip code to city, state function
    By xcelentform in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-18-2006, 07:10 PM
  5. Extract city, state and zip code from a single cell
    By jajoseph@zoominternet.net in forum Excel General
    Replies: 6
    Last Post: 02-06-2005, 10:06 PM

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