PC Review


Reply
Thread Tools Rate Thread

Data delete and mass copy/paste with macro questions

 
 
jpickering74
Guest
Posts: n/a
 
      14th Jun 2008
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.
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      14th Jun 2008
Instead of making a sheet for each consider using
data>filter>autofilter>filter by the value desired in the first column

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"jpickering74" <(E-Mail Removed)> wrote in message
news:C141E5A9-815F-4439-B934-(E-Mail Removed)...
> 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.


 
Reply With Quote
 
jpickering74
Guest
Posts: n/a
 
      15th Jun 2008
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.


"Don Guillett" wrote:

> Instead of making a sheet for each consider using
> data>filter>autofilter>filter by the value desired in the first column
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "jpickering74" <(E-Mail Removed)> wrote in message
> news:C141E5A9-815F-4439-B934-(E-Mail Removed)...
> > 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.

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy & paste data Satish Microsoft Excel Misc 3 18th Dec 2008 04:50 AM
Copy and paste data using macro Daz Microsoft Excel Programming 3 17th Nov 2008 09:05 AM
1 Create a macro to Copy & paste certain data to another sheet Lin1981 Microsoft Excel Misc 1 6th Nov 2008 11:56 PM
Macro to copy, paste in a range and then delete =?Utf-8?B?R2Fycnk=?= Microsoft Excel Misc 0 23rd Mar 2006 07:37 PM
macro to copy paste non empty data paritoshmehta Microsoft Excel Programming 0 1st Jul 2004 09:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:20 AM.