Data delete and mass copy/paste with macro questions

J

jpickering74

Good afternoon,

First off I want to say that I know pretty much nothing about Excel macros.
I started trying to put one together early this week for a personal database
project that I'm working on, and while it's doing some of the things that I
want, I don't know how to do some of the additional things that I really need
it to. As such, I was hoping that some expert out here would be able to help
me.

The database that I'll be working with is currently 3500 rows and
approximately 30 columns wide on a single worksheet. I've gotten the code to
be able to sort the data how I want it, and I can get it to delete data based
on an array delete code. However, because I want to be able to run the macro
for any one of the currently 5 data values that I'm basing my delete on,
would I be able to use an input box to tell the macro to keep all rows with
that particular value and to delete all others?

The second question that I have may be a little tougher to puzzle out. Once
I have the data truncated down by the particular value that I'm looking for,
I've got the code generating new sheets into the workbook for each unique
value in the first column and renaming the sheets based on that value, which
is what I want, sort of. The macro is currently only copying and pasting the
data from the first 4 columns into the new sheets, which is my initial sort
and search criteria. What I want to have the macro do is, as it is
generating each sheet, to look at a particular cell (it will be the same cell
in all sheets) and paste a range of data from one of two other sheets based
on what the value in that cell is. I know that I probably need to use an
if/elseif/else statement to do this, or possibly an if/else statement where
the if value is X or Y. But I'm having trouble plugging in the code to do
this and actually have it work. Don't know if it is an issue of placement,
the fact that I don't really know what the code should be, or if I would be
better off having the new sheets generate into a new workbook and do the
copy/paste later in the macro.
Please help.

Also, a BIG thank you goes out to Ron de Bruin for his awesome excel macros
page, without which I wouldn't really even be started with this project.
 
D

Don Guillett

Instead of making a sheet for each consider using
data>filter>autofilter>filter by the value desired in the first column
 
J

jpickering74

I did the autofilter thing the other day. But the data that I'm sorting is
the raw data, and not in a presentation format. It is extremely difficult to
read in the database form, thus the creation of new presentation sheets for
each record.
 

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