+ Reply to Thread
Results 1 to 19 of 19

insert column for all sheets and arrange based on another

  1. #1
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    insert column for all sheets and arrange based on another

    hi
    the sheet report this is the standard to insert the column A for the others sheets and fill the missed items and arrang them . all of this occures based on sheet report .
    so when see to sheet REPORT should match column B,C,D with the others sheets . every item is existed in sheet report in column A depends on start from first row for the item and end before TOT row . when match with the others sheets sould arrange the whole data based on sheet REPORT .
    I put the expected result from column G: K for sheets(OPLER,OSLER,OMLER) but the real result should show from column A:E after insert the column
    Attached Files Attached Files
    Last edited by KalilMe; 12-12-2021 at 05:09 AM.

  2. #2
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    Re: insert column for all sheets and arrange based on another

    is there any help?

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: insert column for all sheets and arrange based on another

    Code for macro
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    Re: insert column for all sheets and arrange based on another

    excellent ! but I note in first sheet doesn't arrange correctly based on sheet REPORT .it makes FO before VEG .the VEG should be before FO based on sheet REPORT .
    may you fix it please ?

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: insert column for all sheets and arrange based on another

    Revised code
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 12-18-2021 at 12:36 PM.

  6. #6
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    Re: insert column for all sheets and arrange based on another

    again the code has just become arranging in first sheet. the others sheets don't arrange based on sheet REPORT.
    did you note it?

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: insert column for all sheets and arrange based on another

    All sheets are sorted as per report sheet. Upload file showing other sheets are not sorted. They have only FR and VEG.

  8. #8
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    Re: insert column for all sheets and arrange based on another

    I highlighted the data in second & third sheets . they are not arranged based on sheet REPORT .the right should be in data as in columns G: K and compare with sheet REPORT . you will understand I'm right
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: insert column for all sheets and arrange based on another

    Revised code is here. Try this
    Please Login or Register  to view this content.
    Last edited by kvsrinivasamurthy; 12-19-2021 at 05:48 AM.

  10. #10
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    Re: insert column for all sheets and arrange based on another

    that's better ! I have last thing if I have already inserted column and add new data in all sheets and when run the macro again . it shows error . can replace the data when run macro repeatedly without shows error ?
    thanks again

  11. #11
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: insert column for all sheets and arrange based on another

    Pl see post #9.
    Use the file Columns in Post#1.
    Last edited by kvsrinivasamurthy; 12-19-2021 at 07:16 AM.

  12. #12
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    Re: insert column for all sheets and arrange based on another

    I did it . still shows error when run macro repeatedly

  13. #13
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: insert column for all sheets and arrange based on another

    Show in the file where is the problem. Which code is used.

  14. #14
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: insert column for all sheets and arrange based on another

    File taken from first post ad code in post#9 is used. The out put file is attached.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    Re: insert column for all sheets and arrange based on another

    thanks again ! it works when run from the first time , but when run repeatedly it shows the error object variable or with block variable not set in this line
    HTML Code: 
    Attached Files Attached Files

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: insert column for all sheets and arrange based on another

    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    Re: insert column for all sheets and arrange based on another

    @jindon you're super great !
    many thanks

  18. #18
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: insert column for all sheets and arrange based on another

    It was not told in the beginning that macro has to run repeatedly. The code below works for repeated run.

    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    345

    Re: insert column for all sheets and arrange based on another

    It was not told in the beginning that macro has to run repeatedly.
    wthout any doubt. you're absolutely right. I admit this is my mistake and this is what I try to tell you in post#10 but it doesn't seem you to understand me .
    my apologies ! much appreciated for your updating

+ 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. [SOLVED] arrange & highlight data between two sheets based on column
    By Hasson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2021, 02:12 PM
  2. [SOLVED] Match between two sheets and bring missed elements based on column and arrange again
    By abdo meghari in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-24-2021, 10:46 AM
  3. macro insert three columns repeatedly with all values based on multiple sheets
    By KalilMe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2021, 05:41 AM
  4. [SOLVED] Arrange column data from multiple sheets based on two columns each sheet has.
    By Choochi in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-01-2020, 07:49 PM
  5. create new sheets, arrange columns, add hyperlink, send as html email
    By shootstill in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2014, 03:03 PM
  6. how to re-arrange columns based on a specified order
    By 2seas in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-05-2012, 10:06 AM
  7. Macro to re-Arrange data based on 2 columns values
    By hisham2k11 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-22-2011, 12:53 PM

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