Transfer data to another worksheet by name?

NickCraig

New Member
Joined
Jul 18, 2002
Messages
36
Hello
I am trying to write a Makro which transfers data to another worksheet depending on whose name a line relates to e.g.

Master worksheet contains
Col A B C D
Line 1 Andy London 10 250
Line 2 Fred Glasgow 30 90
Line 3 John Bristol 45 78
Line 4 Pete Poole 5 500
Line 5 Andy Southend 50 120

I would then a makro to turn blank worksheet "Andy" into:
Col A B C D
Line 1 Andy London 10 250
Line 2 Andy Southend 50 12

And another makro to turn blank worksheet "Fred" into:

Col A B C D
Line 1 Fred Glasgow 30 90

etc etc

Is this doable, obviously with a lot more data than just this?!
Thanks
Nick
 
It's tricky if there isn't a header row, because AutoFilter assumes there is one. Can't you insert one? It can be blank, except for column A where you are using End(xlDown) to find all the records. Or you could use:

With Source.Range("A4:U" & Source.Range("A65536").End(xlUp).Row)
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
OK, not totally sure if I have got the meaning of "header row" correct.

In my "input" sheet, row 1 has a title, row 2 has heading e.g. name, order number, product etc. and row 3 is blank. The data starts on row 4.

I have tried deleting row 3 and resetting the references etc. but the bug still remains.

Am I missing something on what the "header row" should contain?

Thanks
Nick
 
Upvote 0
You could start you filter on row 3. Better still delete the blank row 3 and start at row 2. Then it will copy the header rows, so you need to paste to A2 on the Active Sheet.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,112
Members
453,021
Latest member
Justyna P

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