PDA

View Full Version : Copy Rows from External Data Query



sth9669
01-08-2009, 09:24 AM
Hi Everyone,

I'm new to the board as a member, but I've been coming here for excel tips for years, but I finally found one I couldn't quickly figure out. I have to build a report that contains a dashboard page on the front for summary data and a number of other pages for sales data in different statuses with the worksheet name being the status. Before I had a seperate external data query on each page, but that gets to be really tedious to update 8 pages across 5 regions.

What I'm trying to do now is have one data page at the end of the worksheet to query all the data, and then have a subroutine that will go through the data page and update all the records for the current region and status. The region is held on the dashboard page in the A1 cell and the other worksheets besides the data page and the dashboard page are all named after the statuses I'm searching for.

So in short, I need a Sub that goes to each page and clears out anything below row 1 and then goes to the data page and starting at A2, goes down the list (or goes through the Named Range "Query_From_SLXPROD") and matches up column A with the Region value held on Dashboard:A1 and looks at the worksheet name to match up column G and then copies the rows over to the worksheet with the appropriate status name starting at A2.

Thanks guys, you can really save me on this one. I'm pretty good at adapting code once I see it, but I'm not good enough in VBA to write this from scratch.

Scott

georgiboy
01-08-2009, 10:16 AM
Welcome to the forum :hi:

Are you able to post a sample workbook with dummy data?