+ Reply to Thread
Results 1 to 6 of 6

Macro to assist with formatting.

  1. #1
    Registered User
    Join Date
    03-16-2012
    Location
    Moncton, NB, Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    Macro to assist with formatting.

    I have a report which is exported to excel and I want to clean it up a little before I work with the data. There are specific rows that I wish to remove since they are extraneous to my work and I'm having some difficulties.

    I found the following code snippet from MaczaQ in another thread and modified the find section to look for the text that I want and I modified the result section removing the resize(2) so it only deletes the single row in which the text is located ... Works great ... however I have 6 other strings to look for and delete the corresponding row and I need some assistance in creating a loop that will look for and delete the rows containing the other 6 variables all at once.

    Please Login or Register  to view this content.
    Thank you in advance for any help you might be able to offer.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,056

    Re: Macro to assist with formatting.

    Try this code. Just replace the "string1", string2", etc. with your strings.
    Please Login or Register  to view this content.

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro to assist with formatting.

    TJ Saulnier,

    Alternate...
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    03-16-2012
    Location
    Moncton, NB, Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Macro to assist with formatting.

    Hey thanks for the responses ... Tigeravatar I believe your solution is a little closer to what I'm attempting to do ... I do have a couple of questions though .. 1- the line Set rngFound = Columns .. can this be a range of columns A through F ( I neglected to mention in my original post that not all the search criteria is in column A) and 2- when i enter the strings in the array line does it matter if there is other text in the same row following the search string or will the loop evaluate to true if it finds an instance of the string amongst all the text in the cell.

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro to assist with formatting.

    Yes on both counts

  6. #6
    Registered User
    Join Date
    03-16-2012
    Location
    Moncton, NB, Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Macro to assist with formatting.

    Excellent .. thanks much for the assist. I have to say as well that this is without question one of the most helpful forums I've ever used. My hats off to you all.

+ 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