Move rows to sheets based on alpha numeric value

eosride

New Member
Joined
May 26, 2018
Messages
13
Greetings,

I'm officially stumped on this one. I've searched numerous threads and cannot find what I'm looking for. I'd like a macro created that will copy or paste, whichever is less time consuming, entire rows into other sheets based on a range of alpha numeric characters found in column A. In this example, Sheet1 contains my data. I'd like the rows with PRIME ranges G0001 through G0299 moved to sheet G0001-G0299 Y&P. The process would need to be repeated for each additional prime range until Sheet1 is empty and all data is moved to the corresponding sheets. Thanks in advance for all of your help!



[TABLE]
<tbody>[TR]
[TH][/TH]
[TH]A[/TH]
[TH]B[/TH]
[TH]C[/TH]
[TH]D[/TH]
[TH]E[/TH]
[TH]F[/TH]
[TH]G[/TH]
[TH]H[/TH]
[TH]I[/TH]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Prime[/TD]
[TD="align: center"]RSL-1[/TD]
[TD="align: center"]Cases[/TD]
[TD="align: center"]Ven-Stk #[/TD]
[TD="align: center"]RSL-2[/TD]
[TD="align: center"]Cases[/TD]
[TD="align: center"]RSL-3[/TD]
[TD="align: center"]Cases[/TD]
[TD="align: center"]Total[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]G0011[/TD]
[TD="align: center"]K5179[/TD]
[TD="align: center"]36[/TD]
[TD="align: center"]fnwkqntke1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]36[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]G0290[/TD]
[TD="align: center"]K5174[/TD]
[TD="align: center"]67[/TD]
[TD="align: center"]fnwkqntke23[/TD]
[TD="align: center"]K5176[/TD]
[TD="align: center"]73[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]140[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]G0312[/TD]
[TD="align: center"]K5068[/TD]
[TD="align: center"]72[/TD]
[TD="align: center"]fnwkqntke24[/TD]
[TD="align: center"]K5081[/TD]
[TD="align: center"]232[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]304[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]G0330[/TD]
[TD="align: center"]J4011[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]fnwkqntke25[/TD]
[TD="align: center"]J4209[/TD]
[TD="align: center"]37[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]71[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]G0590[/TD]
[TD="align: center"]K5279[/TD]
[TD="align: center"]120[/TD]
[TD="align: center"]fnwkqntke46[/TD]
[TD="align: center"]K5286[/TD]
[TD="align: center"]65[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]185[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]G0598[/TD]
[TD="align: center"]J5028[/TD]
[TD="align: center"]80[/TD]
[TD="align: center"]fnwkqntke47[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]80[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]G2127[/TD]
[TD="align: center"]J8273[/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]fnwkqntke48[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]9[/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: center"]G2225[/TD]
[TD="align: center"]K4172[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]fnwkqntke49[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]8[/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: center"]G2853[/TD]
[TD="align: center"]J8189[/TD]
[TD="align: center"]33[/TD]
[TD="align: center"]fnwkqntke73[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]33[/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD="align: center"]G3074[/TD]
[TD="align: center"]Y4021[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]fnwkqntke74[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD="align: center"]G3873[/TD]
[TD="align: center"]J9321[/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]fnwkqntke94[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]13[/TD]
[/TR]
[TR]
[TD="align: center"]13[/TD]
[TD="align: center"]H0029[/TD]
[TD="align: center"]Y4268[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]fnwkqntke95[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]14[/TD]
[TD="align: center"]H0935[/TD]
[TD="align: center"]Y4011[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]fnwkqntke123[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]15[/TD]
[TD="align: center"]H1021[/TD]
[TD="align: center"]M4337[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]fnwkqntke124[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]8[/TD]
[/TR]
[TR]
[TD="align: center"]16[/TD]
[TD="align: center"]H1960[/TD]
[TD="align: center"]J6052[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]fnwkqntke156[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]8[/TD]
[/TR]
[TR]
[TD="align: center"]17[/TD]
[TD="align: center"]I0073[/TD]
[TD="align: center"]Y4138[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]fnwkqntke157[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]18[/TD]
[TD="align: center"]I0763[/TD]
[TD="align: center"]M4027[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]fnwkqntke181[/TD]
[TD="align: center"]M4197[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]14[/TD]
[/TR]
</tbody>[/TABLE]
[CENTER][COLOR=#161120][B]Sheet1[/B][/COLOR][/CENTER]

 
Last edited by a moderator:
Now it only happens randomly. I ran the entire script 8 times with no issues until it finally crashed on the 9th try. I'm stumped!
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Does it always fail on the Autofilter line?
If so what is the error message?
 
Last edited:
Upvote 0
Run-time error '-2147417848 (80010108)': Method 'AutoFilter' of object 'Range' failed.

I was only able to debug once before excel crashed.
 
Upvote 0
Unfortunately I've no idea why that's happening.
Especially when it's random.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,210
Members
453,023
Latest member
alabaz

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