+ Reply to Thread
Results 1 to 16 of 16

Move columns in downloaded sheet automatically

  1. #1
    Registered User
    Join Date
    01-03-2022
    Location
    Ukraine
    MS-Off Ver
    Office 365 (Windows 10 64-bit)
    Posts
    8

    Move columns in downloaded sheet automatically

    Hey everyone!

    I've got a problem with my sheets. Basically I download a sheet with info, but I need the columns to be in specific order (like column G instead of C, insert column K between D and E and so on) and I have to do it manually, is there any way to do it like in one click or by command? Also would be nice if it's possible to insert a prepared and formatted header (like name, account, date) as it will obviously mix up when I move columns. For now I do it by copy-pasting from another file. Any ideas?

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Move columns in downloaded sheet automatically

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 non-editable pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet complete with an explanation and some expected results.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Move columns in downloaded sheet automatically

    Administrative Note:

    Welcome to the forum.

    Members will tailor the solutions they offer to the version of Office (Excel) that you have. Please check that your forum profile is up-to-date in this respect: 2111 is a release number, NOT your actual version. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.

    I think you will need VBA for this - shall I move the thread for you?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    01-03-2022
    Location
    Ukraine
    MS-Off Ver
    Office 365 (Windows 10 64-bit)
    Posts
    8

    Re: Move columns in downloaded sheet automatically

    Thank you and sorry for being inattentive

    Please move if you think it should be moved. Working on that sample right now, thanks!

  5. #5
    Registered User
    Join Date
    01-03-2022
    Location
    Ukraine
    MS-Off Ver
    Office 365 (Windows 10 64-bit)
    Posts
    8

    Re: Move columns in downloaded sheet automatically

    Here is the sample sheet. The first worksheet is raw data, and second is what I need to have, all columns moved to this specific order, added header and formatting, the rest of columns need to be deleted.
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Move columns in downloaded sheet automatically

    Is it OK to leave the original data? If so, a simple formula will do this...

  7. #7
    Registered User
    Join Date
    01-03-2022
    Location
    Ukraine
    MS-Off Ver
    Office 365 (Windows 10 64-bit)
    Posts
    8

    Re: Move columns in downloaded sheet automatically

    Yes, basically I need the original data, just another order of columns and deletion of not needed columns.

    Can you please advise on the formula you are talking about?

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Move columns in downloaded sheet automatically

    =IFERROR(LET(a,INDEX(Sheet1!$A$2:$AB$200,,MATCH(A$1,Sheet1!$A$1:$AB$1,0)),FILTER(a,a<>"","")),"")

    copied across. In Ukraine... maybe you need ; instead of , (I just don't know!!). See sheet.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-03-2022
    Location
    Ukraine
    MS-Off Ver
    Office 365 (Windows 10 64-bit)
    Posts
    8

    Re: Move columns in downloaded sheet automatically

    Thank you! I checked it out and it could work, but if I delete the source sheet, all fixed and formatted contents disappear too, so it's a good idea, but doesn't fully solve my task. Maybe there is a way to modify the existing sheet instead of working in new one?

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Move columns in downloaded sheet automatically

    Thats why I asked you if it was OK to leave the original data... and you said "yes"

  11. #11
    Registered User
    Join Date
    01-03-2022
    Location
    Ukraine
    MS-Off Ver
    Office 365 (Windows 10 64-bit)
    Posts
    8

    Re: Move columns in downloaded sheet automatically

    Ohh, sorry. I thought you mean the data itself, but not the raw worksheet. Then the answer is no, but again, I appreciate the formula you gave me.

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Move columns in downloaded sheet automatically

    Perhaps using Get & Transform will accomplish what you want.
    Here is the Power Query Advanced Editor code used to produce the green/white table on Sheet2:
    Please Login or Register  to view this content.
    Note that in order to use Get & Transform the data range on Sheet1 will need to be converted to an Excel table (Ctrl + t)
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  13. #13
    Registered User
    Join Date
    01-03-2022
    Location
    Ukraine
    MS-Off Ver
    Office 365 (Windows 10 64-bit)
    Posts
    8

    Re: Move columns in downloaded sheet automatically

    Thank you! This one is really helpful, and does what I need. Pardon me for newbie question, but is there a way to do it like "one-click"? Because now I have to do so many steps so I'm not sure if it's faster than do the task manually: convert the table - open Data-From File-Choose file and sheet, open them - Open Advanced Editor - Paste the code - Process - Delete original worksheet - Format the new table the way I need it to look like. Maybe I'm missing some shortcut?

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Move columns in downloaded sheet automatically

    If it can be done "one-click" that would likely require VBA of which I know too little to help.
    We may be able to speed up the process by one step if we understand what "Format the new table the way I need it to look like" means.
    Do you need the values in the "Numbers" columns left aligned like text?
    Is there any other formatting needed other than the fill color of column header cells?

  15. #15
    Registered User
    Join Date
    01-03-2022
    Location
    Ukraine
    MS-Off Ver
    Office 365 (Windows 10 64-bit)
    Posts
    8

    Re: Move columns in downloaded sheet automatically

    Hey Jete, yes, all formatting I need is left alignment of everything, put whole table with "All borders"; and DATE in format "January/06/2022 12:10:28", NUMBER 6 and 4 in format 123.45 (2 numbers after dot). How do I do that?


    UPD. Well, I just figured out how to beatify the table with one click using Table Design and saved preset there So only open question left is what Date and Number type I need to get formats like those above and left alignment.
    Last edited by MatthewGreen; 01-06-2022 at 06:34 AM.

  16. #16
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Move columns in downloaded sheet automatically

    The following Advanced Editor code produces a text column with the date in "January/06/2022 12:10:28" format.
    NUMBER 6 and NUMBER 4 are in decimal number format.
    Please Login or Register  to view this content.
    The formula of all NUMBER columns could be set to text so that they will left align, however that would make further calculation complicated so in the attached file I chose cell A16 > pressed Ctrl, Shift, right arrow > pressed Ctrl, Shift, down arrow and then selected align left from the Home tab.
    Let us know if you have any questions.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 06-14-2018, 10:16 AM
  2. automatically save downloaded file
    By miso.dca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2018, 06:11 PM
  3. Replies: 6
    Last Post: 09-22-2014, 05:57 AM
  4. [SOLVED] Automatically move an entire row form a protected sheet to different sheet
    By boboivan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-26-2014, 06:02 PM
  5. Replies: 2
    Last Post: 08-27-2013, 05:01 PM
  6. [SOLVED] How to automatically sort the columns (move the columns around)
    By OldGrantonian in forum Excel General
    Replies: 4
    Last Post: 08-18-2013, 07:44 AM
  7. Modifying a downloaded cell automatically
    By spike999 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-19-2007, 07:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1