Using a macro to paste a row that contains a specific value

  • Thread starter Thread starter HoundofCullin
  • Start date Start date
H

HoundofCullin

I've another macro(or anyway this could be accomplished) query.

What I have is another trucklog (so far they're pleased with the
other, thanks to you people :D) That has multiple Identicle sheets.

Now the main sheet has a column (col B to be percise) named "Haul #".

What I need is to have it copy rows from the Main Sheet into the
identicle ones based on the data in the "Haul #".
So basically the rows that have 365 in the "Haul #" column go to one
sheet. The rows with 355 in the "haul #" goes into yet another... so on
and so forth.

How on earth do I accomplish it?

Plus if you wanna get real complicated it'd help (though not needed) if
I have an easy way to update which haul# goes to what sheet daily (cuz
each day there will be a different set of haul numbers). But like I
said... this is not entirely required.

Thanks, Josh
 
The last question you have regarding easy update of the Haul# - Sheet Name
relation is easy to answer. Do this:
Insert a new sheet, name it something like Utility or whatever. This sheet
will be hidden in normal use to decrease clutter.
List all your Haul#s in Column A and all the corresponding destination sheet
names in Column B.
Add to or delete from or change the contents of this table any time you want
to.
The macro to do the copying will use that table to get the sheet name.
Done.

The macro that will do the copying will simply loop through column B of the
main sheet, find the destination sheet name for the Haul# and copy that row
to that sheet. The large number of data layout variations keep me from
writing you a macro that will be of any use to you. Here are some questions
for you:
1. Where in the destination sheet do you want the row placed? First
empty row from the top?
2. Are there many instances of the same Haul# in the main sheet? This
would drive how the macro would loop through the Haul#s. For instance, if
the same number repeats many times it would be prudent to filter the data on
each Haul# and then copy the filtered data en mass rather than loop through
each row individually.
3. Will some of the Haul# rows already have been copied or are they all
fresh every time? In other words, do you want ALL the rows copied every
time you execute the macro?
HTH Otto
 
Ok... I appreciate the reply. I'll answer your questions of my questio
in the order you asked them.


1. That's right. I'd like for the destination of them to be in the 1s
empty row from the top. That way each time another entry meeting th
required crit. goes down below the last.

2. Yes, there are many instances of hte same haul number on the mai
sheet. Because some of the trucks'll be going to one Haul and some t
another and some to yet another (you get the idea).

3. The Boss-man would like (though if it's not possible i MIGHT be abl
to talk him out of it) for it to update with each running of th
macro... so he can sorta keep an eye on what's gone where throughou
the day. So if the macro can get it to bring over only new data (i.e
the rows that aren't there already) that'd be for the better.


Thanks, Jos
 
Argh! I just can't seem to get this stupid thing working:( no matte
what I do it just goes kaput!

If anyone can help me I will bow down before your awe inspiring skills


Please if you understand what I need I'ld love for some assistance..
if you don't understand lemme knw and I'll extrapolate further.


Thanks, Jos
 
Hey otto... I'd like to say I have recieved the file... but I don't know
where to look for it. Is it on it's way in the email? or did you send
it in another manner?
 
Sorry to keep posting all these messages... but I think I hav
discovered why I've not recieved any file from you.

I'm subscribed through the excel forum so it's not actually sending i
to me. So Otto, if it's not too much trouble would you try sending i
to me at:

(e-mail address removed)

Thanks again, Jos
 
Back
Top