ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I sort data into 2 worksheets in excel vba? (https://www.excelbanter.com/excel-worksheet-functions/14506-how-do-i-sort-data-into-2-worksheets-excel-vba.html)

luk_sr

How do I sort data into 2 worksheets in excel vba?
 
Here's the situation...

I need to take the fifth digit of a six digit strText. If the fifth digit
is even, I need to store the data row in worksheet(Controlled), Else if the
fifth digit is odd, then store the data row in worksheet(Experimental).

After sorting current records, I need to create a form for data input. I
figure it would be easier to have the data separated during initial processes.

I thought of using the inStr function, but this would only work if I first
put spaces between each digit, right. If someone knows of an easier way to
do this, please help.

CLR

Here's one way.............

=IF(ISODD(MID(A1,LEFT(A1,1)+4,1)),"ODD","EVEN")

This formula will determine if the 5th digit in A1 is odd or
even..........put it in a helper column and copy down (assuming your data
is in column A)..........then Copy PasteSpecial values on that column to
replace the formulas and do Autofilter and pick the odd's or the even's and
copy that field to another sheet, then do it again for the opposite
one............turn on the Macro recorder first and you got the whole thing
in a macro to run for next time..........

hth
Vaya con Dios,
Chuck, CABGx3

"luk_sr" wrote in message
...
Here's the situation...

I need to take the fifth digit of a six digit strText. If the fifth digit
is even, I need to store the data row in worksheet(Controlled), Else if

the
fifth digit is odd, then store the data row in worksheet(Experimental).

After sorting current records, I need to create a form for data input. I
figure it would be easier to have the data separated during initial

processes.

I thought of using the inStr function, but this would only work if I first
put spaces between each digit, right. If someone knows of an easier way

to
do this, please help.





All times are GMT +1. The time now is 09:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com