copy paste filtered list from column B: to A: in vba

lefty38

Board Regular
Joined
Oct 27, 2005
Messages
85
I have a list of cells - when I filter on emp_type for Manager in column C
I can select all of the cells in column B then click on the "green dot" in the green select box and drag it (Fill_Left) over to column A - copying the filtered text to column A

How can this be accomplished in VBA?

other info
excel 2013
rows of data can be any length

Thank you for the help this forum provides

beginning table
[TABLE="class: grid, width: 445"]
<tbody>[TR]
[TD]Mgr
[/TD]
[TD]Employee
[/TD]
[TD]Pay Code
[/TD]
[TD]Emp_Id
[/TD]
[/TR]
[TR]
[TD] Michael
[/TD]
[TD] Christopher
[/TD]
[TD]Employee
[/TD]
[TD]046
[/TD]
[/TR]
[TR]
[TD] Tom
[/TD]
[TD] Travis
[/TD]
[TD]Employee
[/TD]
[TD]146
[/TD]
[/TR]
[TR]
[TD] Nikhil
[/TD]
[TD] Joel
[/TD]
[TD]Manager
[/TD]
[TD]244
[/TD]
[/TR]
[TR]
[TD] Joel
[/TD]
[TD] Robbie
[/TD]
[TD]Employee
[/TD]
[TD]175
[/TD]
[/TR]
[TR]
[TD] Christopher
[/TD]
[TD] Stanton
[/TD]
[TD]Manager
[/TD]
[TD]712
[/TD]
[/TR]
[TR]
[TD] Christopher
[/TD]
[TD] Stanton
[/TD]
[TD]Manager
[/TD]
[TD]712
[/TD]
[/TR]
[TR]
[TD] Michael
[/TD]
[TD] Ronald
[/TD]
[TD]Employee
[/TD]
[TD]795
[/TD]
[/TR]
[TR]
[TD] Michael
[/TD]
[TD] Harry
[/TD]
[TD]Employee
[/TD]
[TD]773
[/TD]
[/TR]
[TR]
[TD] Mark
[/TD]
[TD] Edward
[/TD]
[TD]Manager
[/TD]
[TD]161
[/TD]
[/TR]
[TR]
[TD] Mark
[/TD]
[TD] Edward
[/TD]
[TD]Manager
[/TD]
[TD]161
[/TD]
[/TR]
[TR]
[TD] Tan
[/TD]
[TD] Paul
[/TD]
[TD]Employee
[/TD]
[TD]815
[/TD]
[/TR]
[TR]
[TD] Kevin
[/TD]
[TD] Justin
[/TD]
[TD]Employee
[/TD]
[TD]127
[/TD]
[/TR]
</tbody>[/TABLE]

Desired output

only the Employee name was copied to Manager name where filtered (Manager) data was selected
[TABLE="class: grid, width: 445"]
<tbody>[TR]
[TD]Mgr
[/TD]
[TD]Employee
[/TD]
[TD]Pay Code
[/TD]
[TD]Emp_Id
[/TD]
[/TR]
[TR]
[TD] Michael
[/TD]
[TD] William
[/TD]
[TD]Employee
[/TD]
[TD]150
[/TD]
[/TR]
[TR]
[TD] Michael
[/TD]
[TD] Christopher
[/TD]
[TD]Employee
[/TD]
[TD]046
[/TD]
[/TR]
[TR]
[TD] Tom
[/TD]
[TD] Travis
[/TD]
[TD]Employee
[/TD]
[TD]146
[/TD]
[/TR]
[TR]
[TD] Joel
[/TD]
[TD] Joel
[/TD]
[TD]Manager
[/TD]
[TD]244
[/TD]
[/TR]
[TR]
[TD] Joel
[/TD]
[TD] Robbie
[/TD]
[TD]Employee
[/TD]
[TD]175
[/TD]
[/TR]
[TR]
[TD] Stanton
[/TD]
[TD] Stanton
[/TD]
[TD]Manager
[/TD]
[TD]712
[/TD]
[/TR]
[TR]
[TD] Stanton
[/TD]
[TD] Stanton
[/TD]
[TD]Manager
[/TD]
[TD]712
[/TD]
[/TR]
[TR]
[TD] Michael
[/TD]
[TD] Ronald
[/TD]
[TD]Employee
[/TD]
[TD]795
[/TD]
[/TR]
[TR]
[TD] Michael
[/TD]
[TD] Harry
[/TD]
[TD]Employee
[/TD]
[TD]773
[/TD]
[/TR]
[TR]
[TD] Edward
[/TD]
[TD] Edward
[/TD]
[TD]Manager
[/TD]
[TD]161
[/TD]
[/TR]
[TR]
[TD] Edward
[/TD]
[TD] Edward
[/TD]
[TD]Manager
[/TD]
[TD]161
[/TD]
[/TR]
[TR]
[TD] Tan
[/TD]
[TD] Paul
[/TD]
[TD]Employee
[/TD]
[TD]815
[/TD]
[/TR]
[TR]
[TD] Tan
[/TD]
[TD] Paul
[/TD]
[TD]Employee
[/TD]
[TD]815
[/TD]
[/TR]
[TR]
[TD] Kevin
[/TD]
[TD] Justin
[/TD]
[TD]Employee
[/TD]
[TD]127
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
In my description emp_type should be pay cd in column C
the green dot is located in the lower right corner of a selected cell

do I need to better describe the scenario ?
Thanks
 
Upvote 0
How about
Code:
Sub FillLft()

    Dim UsdRws As Long
    
    UsdRws = Range("C" & Rows.Count).End(xlUp).Row

    Columns(3).AutoFilter
    Range("C1:C" & UsdRws).AutoFilter Field:=1, Criteria1:="Manager"
    Range("A2:B" & UsdRws).FillLeft
    Columns(3).AutoFilter
    
End Sub
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,242
Members
452,623
Latest member
russelllowellpercy

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