VBA Query - move row based on commission descriptions

folz

New Member
Joined
Nov 18, 2019
Messages
21
Hello There

We receive one excel worksheet with roughly 5000 rows of commission data. We manually sort and then cut/paste the rows to a different worksheet based on the commissions description. There are roughly 30 different types of commission descriptions that need to be moved to one of our 8 worksheets. Is there a VBA code available to would magically move everything to its proper worksheet? The commission descriptions are all in one column and an example would be....."Feature Add" in column BM pulls the entire row to worksheet "MOB".

Help please, thanks Mike
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
My pleasure & thanks for the feedback
 
Upvote 0
Have one more ask. Need to easily identify if any of the rows did not move via the macro. Maybe we can we cut instead of copy, or find some other way to see rows that were not captured by the macro? Thank you
 
Upvote 0
How about highlighting rows that were copied like
Rich (BB code):
        For i = 0 To Dic.Count - 1
            .AutoFilter 65, Split(Dic.items()(i), ","), xlFilterValues
            .Offset(1).Copy Sheets(Dic.keys()(i)).Range("A2")
            .Offset(1).Interior.Color = 45678
        Next i
 
Upvote 0
Wonderful, that will totally work. The first row is not being copied for some reason, even though the row below it has the same criteria.

1574267949079.png
 
Upvote 0
In a blank cell put
=BM2=BM3
What does it return?
 
Upvote 0
Oops, it should be
Rich (BB code):
    With Sheets("Sheet1").ListObjects("Table1").DataBodyRange
        .Columns.Hidden = False
        For i = 0 To Dic.Count - 1
            .AutoFilter 65, Split(Dic.items()(i), ","), xlFilterValues
            .Copy Sheets(Dic.keys()(i)).Range("A2")
            .Interior.Color = 45678
        Next i
        .Parent.ShowAllData
    End With
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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