Results 1 to 8 of 8

Macro based on header search

Threaded View

  1. #1
    Registered User
    Join Date
    10-13-2011
    Location
    OKC
    MS-Off Ver
    Excel 2007
    Posts
    5

    Smile Macro based on header search

    I need a macro to run that will save Zip and Zip+4 in a certain format (00000 and 0000 respectively). The issue is that I have about 8 different files this macro needs to run on and the Zip and Zip+4 field is not in the same location every time. I know how to do the macro to run the formatting, I now need a macro that will search every cell in the first row and when it finds ZIP will format as needed (00000) and when it finds ZIP+4 will format as needed (0000). In addition to this, the field does not have common naming, sometimes it will simply be ZIP or Zip+4 but other times it will be CompanyZip and CompanyZip+4 so the search needs to search the cell contents for a non exact match. It also only needs to search the first row, nothing else.

    It would be good (not needed) if we could also not apply the macro if the column is not populated past the first row. Some projects have multiple fields that will hold zip but not all projects will have that info populated.

    This code will be part of existing code that is used to save each file as pipe (|) delimited so it does not need to be stand alone code.

    Any help is greatly appreciated!! Feel free to ask any questions needed.
    Last edited by cardinalsfan0510; 10-13-2011 at 03:22 PM. Reason: Solved!! Thanks Leith!!

Thread Information

Users Browsing this Thread

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

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