Hi.
i have several columns. A-H. i want to swap between them so H will be A and G will be B ext.
i can't sort them by small/large cause they have text in them.
Thanks a lot
Hi.
i have several columns. A-H. i want to swap between them so H will be A and G will be B ext.
i can't sort them by small/large cause they have text in them.
Thanks a lot
Insert a row before the data. Number the columns in the order you want them. Then sort by column on row 1. Finally, delete the temporary row you inserted.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
but if i have 500 columns it will take me long.
is there any other way by marking them all and put a formula or somthing like that?
thanks, koby.
.... post a sample file: see instruction in yellow banner at top of the page.
Last edited by JohnTopley; 12-13-2022 at 08:12 AM.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
Output on Sheet2![]()
Sub Swap_ALL() Dim ar, arr Sheets("sheet1").Activate ar = [a1].CurrentRegion ReDim arr(1 To UBound(ar), 1 To UBound(ar, 2)) cc = UBound(ar, 2) For c = 1 To UBound(ar, 2) If cc < c Then Exit For For r = 1 To UBound(ar, 1) arr(r, c) = ar(r, cc) arr(r, cc) = ar(r, c) Next r cc = cc - 1 Next c Sheets("sheet2").Activate [a1].Resize(UBound(arr, 1), UBound(arr, 2)) = arr End Sub
exactly.
Thanks a lot.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks