+ Reply to Thread
Results 1 to 3 of 3

Mail merge macro - ensuring only certain rows are pulled from data sheet

  1. #1
    Registered User
    Join Date
    06-27-2009
    Location
    Miami, FL
    MS-Off Ver
    Excel 2010
    Posts
    7

    Mail merge macro - ensuring only certain rows are pulled from data sheet

    Hi all,

    So I have a data sheet which regularly pulls down stock quotes from the internet. I also have a word doc which I use as a template for a mail merge, taking data from the excel file and generating some text to go with the quotes.

    I'm trying to write a macro to automate this process, since I do it so frequently. The trouble is, I have some 'junk' rows in the database, which I don't think I can remove (since they come from a web query). How can I force my macro to ignore those rows? My current code follows:

    Please Login or Register  to view this content.
    I've attached a sample data file. In this case, I only want to use rows 5, 7, 9, 11, 13, 15, 19 and 21. The column names are in row 1. Any help would be much appreciated! It seems like there ought to be a simple way to do this...
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-27-2009
    Location
    Miami, FL
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Mail merge macro - ensuring only certain rows are pulled from data sheet

    *Bump* nonresponse
    Last edited by panaceus; 08-02-2009 at 08:54 AM.

  3. #3
    Registered User
    Join Date
    06-27-2009
    Location
    Miami, FL
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Mail merge macro - ensuring only certain rows are pulled from data sheet

    Alternatively:

    1) Is it possible to edit my web query to omit the junk data? Removing it manually doesn't work because it returns every time the query is refreshed.

    2) Can I add a conditional around my Word code so that it acts only on rows for which the 'Stock' column is not empty? Code follows:


    Please Login or Register  to view this content.

    Couldn't figure out how to make that last bit execute without adding the "IF 1 >0" line.

    3) Is there another way I should be approaching this problem? Any suggestions welcome; I haven't been able to make progress.

+ Reply to Thread

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