Dynamic Workseheets

P

Prej Mehta

Dear Experts,

I have a text file which is created from a database and
looks something like:

Sheet1
2,Sheet1 value1
6,Sheet1 value2
10,Sheet1 value3
1883,Sheet1 value4
1923,Sheet1 value5
Sheet2
1,Sheet2 value1
10,Sheet2 value2
35,Sheet2 value3
1924,Sheet2 value4
1925,Sheet2 value5
Sheet3
1,Sheet3 value1,Sheet3 value1-1
2,Sheet3 value2,Sheet3 value2-2
3,Sheet3 value3,Sheet3 value3-3
4,Sheet3 value4,Sheet3 value4-4
6,Sheet3 value5,Sheet3 value5-5
Sheet4
1,Sheet4 value1
2,Sheet4 value2
3,Sheet4 value3
4,Sheet4 value4
5,Sheet4 value5

When a user opens this file in Excel, they should see
everything before the Sheet2 marker to appear in Work
Sheet1. All rows between Sheet2 and Sheet3 should go into
Work Sheet2. All rows between Sheet3 and Sheet4 should go
into Work Sheet3. And all rows under Sheet4, should go
into Work Sheet4.

Is there a way I can do this easily and without having to
create Excel macro's? I can write any characters into the
text file that may allow this action since I can control
the generation of the output file via SQL statements. I
can also control the delimter between columns as well if
necessary.

Your help will be greatly appreciated.

Cheers,

Prej
 
J

JE McGimpsey

You'll have to use VBA. There's no mechanism in XL to import data to
different sheets automatically.
 
J

Jamie Collins

...
I can write any characters into the
text file that may allow this action since I can control
the generation of the output file via SQL statements.

Have you tried generating the *Excel* file via SQL statements?

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top