+ Reply to Thread
Results 1 to 2 of 2

VBA Count Rows and Print Corresponding Worksheets

Hybrid View

kboy1289 VBA Count Rows and Print... 10-17-2012, 01:26 PM
kboy1289 Re: VBA Count Rows and Print... 10-17-2012, 05:27 PM
  1. #1
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    VBA Count Rows and Print Corresponding Worksheets

    I need help creating a macro that will count the number of rows with data in my current report and then print only the corresponding sheets with that data. The report is run from a data query so the data is constantly changing, there could be 5 rows of data at one point and after a refresh there could be 15 or 1 or none, the possibilities are endless. the only thing that doesn’t change is that the first row of data (not including column headers) is in cell A3. Data from that cells row (all the way to P3) is then connected to a sheet (since this will always be the first row of data I named the first sheet it puts data into “3”, cell A4 and the corresponding row puts data into sheet “4” etc.) the information in each sheet will constantly be changing when the report is refreshed. In the end I want this to be able to just click a macro button that will print only the sheets that data from the report is pulling in to. So if there are 5 rows in the report, I want to only print the first 5 sheets. The sheet with the data is called “Main” and the sheets start from “3” and goes up to “50”. Any help is appreciated, thanks!

  2. #2
    Registered User
    Join Date
    02-01-2011
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: VBA Count Rows and Print Corresponding Worksheets

    also can post copy of spreadsheet if necessary...
    Last edited by kboy1289; 10-19-2012 at 02:41 PM.

+ 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