LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Need help with two Execl VBA problems

I have an Excel application that does a web query once a day into a
Worksheet called MasterFile that's pasted in rows. Each row represents
unique data that has a corresponding labeled worksheet based on what's
in the first cell(A1 through A?). Currently, I paste up to 20 rows of
data into the MasterFile worksheet and populate 20 worksheets from the
MasterFile sheet checking each worksheet for the next empty row. The
anmount of rows is potentially going to increase in the near future,
that means I'll have to manually add more sheets to match the amount
of rows I query in.

First Excel ??: How can I check if a worksheet already exists and if
not create one automatically?

Second Excel ??: How do I streamline the following code:

Sub PopualteSheets()
Worksheets("MasterFile").Range("A1:H1").Copy _
Destination:=Worksheets("Case"). _
Cells(Rows.Count, "A").End(xlUp)(2)

Worksheets("MasterFile").Range("A2:H2").Copy _
Destination:=Worksheets("Field"). _
Cells(Rows.Count, "A").End(xlUp)(2)

Worksheets("MasterFile").Range("A3:H3).Copy _
Destination:=Worksheets("Product"). _
Cells(Rows.Count, "A").End(xlUp)(2)

Worksheets("MasterFile").Range("A4:H4").Copy _
Destination:=Worksheets("Investment"). _
Cells(Rows.Count, "A").End(xlUp)(2)

'The above code is repeated 20 times once for each row in the
MasterFile.
'It copies a row and pastes it in it's corresponding worksheet into
the next empty row.

End Sub

Can the above subroutine be coded into an array or some type of
looping solution so I don't have to keep adding extra code when a new
row of data appears in the MasterFile worksheet??

Thanks,Rich
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Execl Toolbars update B Nieds Excel Discussion (Misc queries) 8 March 13th 08 07:18 PM
Execl print to fit paper Octavio New Users to Excel 1 January 22nd 06 05:31 PM
Execl problem with numbers Peterg Excel Discussion (Misc queries) 1 October 17th 05 05:07 AM
EXECL Michael Reeve Setting up and Configuration of Excel 0 January 7th 05 01:26 AM
execl sheets are blinking always MH Excel Discussion (Misc queries) 3 December 6th 04 03:26 PM


All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"