Writing Rows To A Spreadsheet

S

Sheldon

This is just an example of what I want to do but if I have a worksheet
with, say, 10 rows and 3 columns and I want to write out certain rows
to a new spreadsheet, how can I do that in VBA for Excel? Here are
the specifics:

Row 1 has field headings and should be in every new spreadsheet that
will be created.

Column B in rows 2-10 has the following values in order: (In the
"real" spreadsheet, I don't know how many rows there will be).

red
red
green
green
green
blue
blue
blue
blue
brown

I would like to create four spreadsheets based on the four unique
colors as follows:
Spreadsheet 1 should contain rows 1-3 from the original spreadsheet
and should be named red.xls. Spreadsheet 2 should contain row 1 and
rows 3-5 from the original spreadsheet and be named green.xls, etc.
Any suggestions would be greatly appreciated.

Thank you,
Sheldon Potolsky
 
D

Dave Peterson

I'd start with one of these:

Ron de Bruin's EasyFilter addin:
http://www.rondebruin.nl/easyfilter.htm

Code from Debra Dalgleish's site:
http://www.contextures.com/excelfiles.html

Create New Sheets from Filtered List -- uses an Advanced Filter to create
separate sheet of orders for each sales rep visible in a filtered list; macro
automates the filter. AdvFilterRepFiltered.xls 35 kb

Update Sheets from Master -- uses an Advanced Filter to send data from
Master sheet to individual worksheets -- replaces old data with current.
AdvFilterCity.xls 55 kb
 
S

Sheldon

Dave,
Where can I find AdvFilterRepFiltered.xls or AdvFilterCity.xls? (I
didn't see them in Ron or Debra's site).
Thanks, Sheldon

Create New Sheets from Filtered List -- uses an Advanced Filter to
create
separate sheet of orders for each sales rep visible in a filtered
list; macro
automates the filter. AdvFilterRepFiltered.xls 35 kb

Update Sheets from Master -- uses an Advanced Filter to send data from
Master sheet to individual worksheets -- replaces old data with
current.
AdvFilterCity.xls 55 kb
 

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