USing VBA to copy rows based on condition - amendment to macro needed

kidwispa

Active Member
Joined
Mar 7, 2011
Messages
330
Hi all,

Having trawled through a number of answers on here and other websites I was wondering if someone could help me with this. I have a spreadsheet that is sent over to me by a colleague every day containing 1000's of rows of data which I drop into a worksheet. Having ran a macro to clear out all irrelevant data, I now wish to copy specific rows to the worksheets within the workbook assigned to specific agents we have based on criteria in one column.

I've created a macro that uses autofilter to select the correct agent, then copy the data into the relevant sheet, however the rows in which the data for that agent will begin from will differ on a daily basis.

Is there a way to set the first row of data by agent? Or is there an easier way to achieve this?

If you need more info then please let me know

:)
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
kidwispa,

See if this does what you are looking for:

Norie
DistributeRows
http://www.mrexcel.com/forum/showthread.php?t=315083


If you need more help:

What version of Excel are you using?

You will generally get much more help (and faster) in this forum if you can post your small samples (what you have and what you expect to achieve) directly in the forum.

To attach screenshots, see below in my Signature block: Post a screen shot with one of these:
 
Upvote 0
kidwispa,

See if this does what you are looking for:

Norie
DistributeRows
http://www.mrexcel.com/forum/showthread.php?t=315083


If you need more help:

What version of Excel are you using?

You will generally get much more help (and faster) in this forum if you can post your small samples (what you have and what you expect to achieve) directly in the forum.

To attach screenshots, see below in my Signature block: Post a screen shot with one of these:

Thanks for your reply Hiker - I do usually post my code but this particular macro is about 200 lines long (as there are 15 different agents).

As far as screen shots are concerned, I'm on my work pc and do not have sufficient access to download any software... :(

Will try the suggestion and come back to you...

:)
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top