+ Reply to Thread
Results 1 to 5 of 5

Macro to delete column if it contains specific wording

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Macro to delete column if it contains specific wording

    Hi All

    Really hoping that someone can help and I think this issue is driving me crazy.

    I have designed a Macro that takes a load of raw data and formats in. This works a charm however every now and again an extra column appears called Delivery Priority. This of course throws all the other caluations out. I therefore require some coding that will look at the coloums (It normally is Q but can also appear in others) and delete this. Not sure if this matters however the wording is in row 10

    Any ideas?

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Macro to delete column if it contains specific wording

    Hi,

    something like this? Loop through row 10 for "Delivery Priority" and delete it when found.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-02-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro to delete column if it contains specific wording

    Thanks for the reply? This however doesnt seem to work - any ideas why?

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro to delete column if it contains specific wording

    The code is looking in all used columns and if row 10 has the word "Delivery Priority" it deletes that column. It should work. When you step over using F8, does it show any error, or it does not delete the column?

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro to delete column if it contains specific wording

    Try this one

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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