Hello
I look for macro by using inputbox
so should run inputbox twice first to write sheet and second to write columns as in SH1 sheet F,A,B,D,E,C then will re-order columns as I did the result should be the same columns A:F
as to SH2 first write SH2 sheet into inputbox and show next input box to write columns A,C,B,E,D and will arrange aas I did the result should be the same columns A:E
if write wrong sheet or empty columns , then the code should not work . should inform me write correct sheet or correct columns and keep inputbox is open until write right sheet and filled columns .
I will add new sheets with different columns so each sheet will arrange differently as what I want
also I posted here
re-orders columns for each sheet separately based on using inputbox
result
thanks
I look for macro by using inputbox
so should run inputbox twice first to write sheet and second to write columns as in SH1 sheet F,A,B,D,E,C then will re-order columns as I did the result should be the same columns A:F
as to SH2 first write SH2 sheet into inputbox and show next input box to write columns A,C,B,E,D and will arrange aas I did the result should be the same columns A:E
if write wrong sheet or empty columns , then the code should not work . should inform me write correct sheet or correct columns and keep inputbox is open until write right sheet and filled columns .
I will add new sheets with different columns so each sheet will arrange differently as what I want
also I posted here
re-orders columns for each sheet separately based on using inputbox
re-order (1).xlsm | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | ITEMS | CODES | QTY | REF | INVOICE NO | DATE | ||
2 | 1 | BCMSK/DF54300MC ** TRM1 | 200 | RE001 | IN-12-100 | 02/02/2023 | ||
3 | 2 | BMN-234EWFGHT4500$#TY | 300 | RE002 | IN-12-101 | 03/02/2023 | ||
4 | 3 | BMN3456GH7800/890 | 500 | RE003 | IN-12-102 | 04/02/2023 | ||
5 | 4 | BNMHG1200567HJGFR | 110 | RE004 | IN-12-103 | 05/02/2023 | ||
6 | 5 | BVN*****FGTRXCVJKHU | 90 | RE005 | IN-12-104 | 06/02/2023 | ||
7 | 6 | DFGTREE76899934567 | 80 | RE006 | IN-12-105 | 07/02/2023 | ||
8 | 7 | XCDF453EREWERR234 | 60 | RE007 | IN-12-106 | 08/02/2023 | ||
SH1 |
re-order (1).xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | ITEMS | CODES | DATE | QTY | INVOICE NO | ||
2 | 1 | 123WEDR56GH0987 | 01/01/2023 | 110 | IN-12-100 | ||
3 | 2 | NBTY567XDE342Q12300 | 02/01/2023 | 200 | IN-12-101 | ||
4 | 3 | ASW123BNGHTY6789 | 03/01/2023 | 220 | IN-12-102 | ||
5 | 4 | CVDFHGG VF6789 RE45/700 | 04/01/2023 | 230 | IN-12-103 | ||
6 | 5 | D**HJUYSDFW2345KJI900 | 05/01/2023 | 140 | IN-12-104 | ||
7 | 6 | VBGFDRETMJHGF12344 | 06/01/2023 | 150 | IN-12-105 | ||
8 | 7 | ASTR10089YHHMA1200 | 07/01/2023 | 120 | IN-12-106 | ||
SH2 |
result
re-order (1).xlsm | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | DATE | ITEMS | CODES | REF | INVOICE NO | QTY | ||
2 | 02/02/2023 | 1 | BCMSK/DF54300MC ** TRM1 | RE001 | IN-12-100 | 200 | ||
3 | 03/02/2023 | 2 | BMN-234EWFGHT4500$#TY | RE002 | IN-12-101 | 300 | ||
4 | 04/02/2023 | 3 | BMN3456GH7800/890 | RE003 | IN-12-102 | 500 | ||
5 | 05/02/2023 | 4 | BNMHG1200567HJGFR | RE004 | IN-12-103 | 110 | ||
6 | 06/02/2023 | 5 | BVN*****FGTRXCVJKHU | RE005 | IN-12-104 | 90 | ||
7 | 07/02/2023 | 6 | DFGTREE76899934567 | RE006 | IN-12-105 | 80 | ||
8 | 08/02/2023 | 7 | XCDF453EREWERR234 | RE007 | IN-12-106 | 60 | ||
SH1 |
re-order (1).xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | ITEMS | DATE | CODES | INVOICE NO | QTY | ||
2 | 1 | 01/01/2023 | 123WEDR56GH0987 | IN-12-100 | 110 | ||
3 | 2 | 02/01/2023 | NBTY567XDE342Q12300 | IN-12-101 | 200 | ||
4 | 3 | 03/01/2023 | ASW123BNGHTY6789 | IN-12-102 | 220 | ||
5 | 4 | 04/01/2023 | CVDFHGG VF6789 RE45/700 | IN-12-103 | 230 | ||
6 | 5 | 05/01/2023 | D**HJUYSDFW2345KJI900 | IN-12-104 | 140 | ||
7 | 6 | 06/01/2023 | VBGFDRETMJHGF12344 | IN-12-105 | 150 | ||
8 | 7 | 07/01/2023 | ASTR10089YHHMA1200 | IN-12-106 | 120 | ||
SH2 |
thanks