Combine Data from Multiple Sheets into One Sheet with VBA in Excel

Поделиться
HTML-код
  • Опубликовано: 15 окт 2024

Комментарии • 223

  • @gabrielcortes4046
    @gabrielcortes4046 7 лет назад

    Straight up this man is a genius. I've been doing this manually for years. I figured out how to combine multiple workbooks but never multiple tabs within. This is classic. Thumbs up man!!

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Thanks so much +Gabriel Cortes, really appreciate the kind words!

  • @ryantschirhart6815
    @ryantschirhart6815 2 года назад +1

    Hi Dan, is there a way to do this but to do it so it pastes values and does not paste the formulas within the cells?

  • @undrawingend
    @undrawingend 2 года назад

    This has helped me so much ! If possible how would I have this to identify a specific criteria in a sheet ? I’m trying to create a report for my manager to use for quality and this has helped but it’s pulling cells with no useful data - blank fields with a formula in. Any advice would be amazing !

  • @ganeshnarasimaiah5083
    @ganeshnarasimaiah5083 3 года назад

    HI, i am getting error as Sub or Function not Defined and getting highlighted "LastOccupiedRowNum" please suggest how to solve this

  • @riyaray9244
    @riyaray9244 3 месяца назад

    With your code, how can I add a new column and show each tab name to each row on the "Import" tab where all consolidated data is

  • @Sok518
    @Sok518 8 лет назад

    This is awesome. You are a super star. I have been looking for a way to combine large data from multiple worksheets for few days. You just make my day Dan.

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Thanks so much +Uzana Tonmukayakul!

  • @kryptokats5818
    @kryptokats5818 2 года назад

    Hello bro, can this be modify to copy only rows base only on the specific date that I wanted

  • @senthil5031
    @senthil5031 4 года назад

    Dear
    Dan Wagner,
    I want to copy selected column range only. How to modify the code according to my requirement

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hey +Senthil Kumar.P dealing with selections only is very tricky since the user might mistakenly change his or her selection and not get the correct results. I would suggest modifying the code every time your requirements change to get the columns you need

  • @sonu1754
    @sonu1754 2 года назад

    Hi Dan..thanks aton...but i also want to delete the extra three sheets we had before because we already combines verything into one...so just wnat to have the import sheet and delete the rest of the sheets so can u also show us how we do that?

  • @ramanjeet1111
    @ramanjeet1111 2 года назад

    IZ THERE AN ONLINE WEBSITE WHERE I CAN RUN VBA CODES......AND IT WILL CORRECT ME ACCORDINGLY

  • @marie-lineskaff3371
    @marie-lineskaff3371 4 года назад +2

    Hello Dan! Thank you for this video! It helped so much! How can I copy the values only, not the whole formulas and links in the cells?

    • @DanWagnerco
      @DanWagnerco  4 года назад +2

      Hi +Marie-Line Skaff -- in that case, change line 30 from the one-liner "rngSrc.Copy Destination:=rngDst" to instead be two lines, "rngSrc.Copy" followed by "rngDst.PasteSpecial xlPasteValues"

  • @choweychoco17
    @choweychoco17 3 года назад

    Hi, thank you for this this helps me a lot. Though I have a question, What if I just only want to copy the data coming from other sheets based on my criteria.
    for example I only just want to copy the data that has a "running" status on Notes

  • @kge4mvp
    @kge4mvp 8 лет назад +1

    Hey Dan,
    Lets say I have a workbook (WB1) where sheet1 lets me enter a # value (n), which will then generate n copies of a sheet from a separate workbook (WB2). So for example I enter '3' and I get 3 copies of WB2SHT1. WB1 now has 4 sheets, WB1SH1, and 3 copies of WB2SH1 (This is already done and works, everything from here on out is uncharted territory for me!). WB2SH1 has ~6 or 7 check boxes that will need to correlate with a small range of cells. Currently, the ranges for the check boxes are are in their own sheets in WB2 (sheet 2 thru 8). All the ranges are in same (A1:M12). From WB1, after entering the # of sheets of WB2SH1 I need, I will go into each copy, select the check boxes required for that sheet, and the selected ranges will populate below, starting at B11 on down (if 2 boxes are checked, the first checkbox range (ex, WB2SH2) will populate first on WB1SH2 @ B11, then the next check box range that is checked would populate directly beneath it @ B23).
    My VBA skills are non-existent (user for less than 12 hours). I managed to get this far by asking people on the internet and googling.

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hi +kge4mvp -- really appreciate you taking the time to write that all out, but I'm not sure I understand what you're asking for.
      Can you reach out to me via email with some examples?
      My contact info is at the bottom of this page: danwagner.co/

  • @satishmen11
    @satishmen11 6 лет назад

    Hi,
    I need help with the blank cell issue.
    Scenario: I have a sheet with a blank cell in the center of the data.
    Details: If there is data from A2 to D25 and a cell B15 is blank.
    Now, when I am collating the data, the VBA code stops reading at the blank cell and stops consolidating.
    Query: How to copy the blank cell to the Import sheet.
    The Import sheet must contain the same data as in the original sheets, be it blank or some data.
    Please suggest.. and Thanks in advance.

  • @terrymoran1872
    @terrymoran1872 8 лет назад

    Hi there Dan, I tried this and it worked. Can you tell me what code I would need to add to search for something specific in all the cells from all sheets? From your example, I want to only include the Reporter - FR from all sheets on the import sheet. Thank you.

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hey +Terry Moran -- I'm not sure I understand your question. Do you want to combine specific rows, or just specific cells maybe? Sending an example would be super helpful too, holler at me: dan@danwagner.co

  • @uh0hitzxlo
    @uh0hitzxlo 5 лет назад +1

    How can I combine multiple sheets into one sheet with VBA but only pull specific columns into the one sheeter?

    • @DanWagnerco
      @DanWagnerco  5 лет назад

      Hi +LO Jessick -- I suggest combining all columns (like this VBA does), then deleting the columns you do not need once the combination is complete

  • @abhijithkrishnakumar7939
    @abhijithkrishnakumar7939 4 года назад

    Hello Dan... I seem to have run into some trouble. I'm handling a rather large set of data. When I run the code, Only the first column is being copied and combined whereas I want all the columns and all data to be combined into one sheet. I copy-pasted the code from the link you have given in the description of the video and have not made any changes. Please help

    • @DanWagnerco
      @DanWagnerco  4 года назад +1

      Hello +Abhijith Krishnakumar
      when the code is only copying one column of data the issue is usually that the first Sheet being analyzed for the last column and last row is blank -- check your file for empty (possibly hidden) Sheets and remove them or modify the code to check for cell values before each copy + paste

    • @abhijithkrishnakumar7939
      @abhijithkrishnakumar7939 4 года назад

      @@DanWagnerco Thank you... I worked out a way around it... Since my number of columns are fixed, I changed the code accordingly and it worked for me... But thanks for the prompt reply.. Ill check my file out for the said issues that may have caused the error :)

  • @flim_me5133
    @flim_me5133 4 года назад

    Hello Dan,
    thank you for this video.......
    my question is what you showed in your video all cells are filled so that's y it get copied if suppose some cells are blank in middle of data in sheets from which you are pulling data if you copy with this same VBA code ...while it copied same as it is (i means if cells are blank then in main sheet will it show blank or it will auto filled with other data which is data filled in next cell)...
    i want code if suppose if any columns contains blank cells then it showed be blank as it is when we pull the data form multiple sheets ...please help me in this.....

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hello +Flim_me I am sorry but I do not understand your question, as the code is written it will copy all cells in the Range whether they are empty or not

  • @TheLeotLion
    @TheLeotLion 7 лет назад

    Dan,
    First, great tutorial, has helped a ton.
    I'm looking to consolidate the same tab "Data Tab" from multiple workbooks. Each of the separate workbooks contain several identical tabs and I would like to use a macro to generate a master data table. this video gets me part of the equation, hoping you could help me added wrinkle of multiple workbooks.
    Thanks!!

    • @DanWagnerco
      @DanWagnerco  3 года назад

      Hey +LeoT Lion -- this tutorial explains how to combine data from a single Worksheet in multiple Workbooks into a single master data table, if you combine that technique with the technique in this RUclips video you should be able to accomplish this combination: danwagner.co/how-to-combine-multiple-excel-workbooks-into-one-worksheet-with-vba/

  • @MarvinIgnacio
    @MarvinIgnacio 3 года назад

    I really want to thank you, you're a life saver. Video uploaded Feb 2016 and here's my comment dated Feb 2021.

    • @DanWagnerco
      @DanWagnerco  3 года назад

      Thanks +marvin ignacio I am really happy to hear that this has stood the test of time and helped you out!

  • @khouloudboulsaien574
    @khouloudboulsaien574 3 года назад

    I would like to ask you for VBA code which copy some data from multiple sheets into one sheet

  • @TheBlueysAndBeyond
    @TheBlueysAndBeyond 6 лет назад

    Hi Dan, your video is great, this will help me a lot. I do have a question though, what about combining multiple excel sheets into 1 tab only? Do you have an easy way to do this? Thanks in advance.

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hi +Laurice Lopinto, this tutorial explains how to combine multiple Excel Workbooks together into a single sheet: danwagner.co/how-to-combine-multiple-excel-workbooks-into-one-worksheet-with-vba/

  • @guilhermeagostini1928
    @guilhermeagostini1928 3 года назад

    Hy Dan! Thanks a lot! I have just one question: How can I past my data as Values in the Import sheet. In my case, my sources have formulas and I do not want them as formulas, just their values ...

  • @erlindaeloriaga4607
    @erlindaeloriaga4607 4 года назад

    HI Dan, based on the above worksheet, if there are more than three sheets (tabs) , let's say five different sheets, and I only want the first, second and last sheet of the same worksheet, where would I do that in the VBA?

    • @DanWagnerco
      @DanWagnerco  4 года назад +1

      Hi +ERLINDA ELORIAGA -- unfortunately Sheet order can change really easily, so I strongly suggest you use Sheet names rather than Sheet order to dictate this combination. I wrote a tutorial about combining some Sheets but not others here, and the technique described in that tutorial should work: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/

    • @erlindaeloriaga4607
      @erlindaeloriaga4607 4 года назад

      Dan Wagner thanks very much for your time in replying, appreciate it.

  • @ArunKumar-li6ur
    @ArunKumar-li6ur 5 лет назад

    I tried the same scenario (template) u taught without having any data in one sheet except the header, and after I ran the code, I could see the header has been copied to the import sheet. How can I avoid the column header to be copied if any of the three sheet is empty?

  • @parkerbarker1118
    @parkerbarker1118 4 года назад

    I know this video is old, but hopefully you're still active on here! The macro is running perfectly fine on my file, but not advancing to the additional sheets in my book. for instance, it'll bring in the sheet2 data, but not move on through sheets3-17.. any pointers? I copy and pasted the macro as you have it written.

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hi +Parker Richmond that might be caused by differences between sheet2 and sheets3-17 (do they have different columns populated?), if they are all the same I would insert some Debug.Print statements into the loop to see what is happening on all those other Sheets

  • @jonathanmarin6123
    @jonathanmarin6123 5 лет назад

    Hi Dan, How can i make this code paste as values and only copy 2 sheets instead of every sheet in the workbook

    • @DanWagnerco
      @DanWagnerco  3 года назад

      Hey +jonathan marin -- this tutorial explains how to skip Sheets when combining data: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/

  • @gowthamdasari5739
    @gowthamdasari5739 5 лет назад

    Hi Dan, Is there any way to Import the data in a particular sequence from the individual sheets. Let's say "Peripherals" first and "IOAccess" second and "MemoryDisc" Third. Thanks in advance.
    What is your suggestion and sequence to learn VBA Macros from Scratch as I don't have any technical knowledge.
    Thanks very much for your Commendable videos which are really helping to minimize the manual effort.

  • @reymantan3231
    @reymantan3231 4 года назад +2

    Hi Dan. I get a Sub or Function not defined error.

    • @DanWagnerco
      @DanWagnerco  3 года назад

      Hey +reyman tan -- if you get a "Sub or Function not defined" error, that means you have not copied over ALL the code from the script in the linked tutorial. You need to make sure you copy everything, including the Functions defined at the bottom (these are Public Function LastOccupiedRowNum(Sheet As Worksheet) and Public Function LastOccupiedColNum(Sheet As Worksheet). Ensure that you have all the code copied into your module and you should be all set!

  • @alvinc5563
    @alvinc5563 3 года назад

    Hi Sir, I tried this but only first columns were combined.. please help

    • @DanWagnerco
      @DanWagnerco  3 года назад

      Hi +Alvin C -- if you only get the first column combined, that means line 13 ( lngLastCol = LastOccupiedColNum(wksDst) ) is evaluating to 1, which probably means your "Import" Sheet is empty. This script expects that your "Import" Sheet has the exact same header row, so to fix this you can copy over your header row from one of the data Sheets to your "Import" Sheet then re-run the script

  • @AdemolaAfolabi
    @AdemolaAfolabi 8 лет назад +1

    Sir, the function LastOccupiedColNum() is missing in the example. can you please help with that as well?

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hi +Ademola Afolabi -- the article associated with this walk through, danwagner.co/how-to-combine-data-from-multiple-sheets-into-a-single-sheet/, includes that function. If you're having a hard time finding it there, this should do the trick: gist.github.com/danwagnerco/040402917376969bf362#file-combine_data_from_all_sheets-vb

  • @mout001
    @mout001 6 лет назад

    I've add a snapshot from a file. So end of Mei I want to Copy the data from range "U5:U106", End of June I want to copy range "V5:V102" etc, etc, and copy this into antoher workbook. The problem is how can I pre-define the range based on a cell in the file? E.g.: Reporting Month: "mei-18" in cell "AA5" then the macro will select range "U5:U102" and copy. Or with a Msgbox. etc. Who can help?

  • @reefrocks12
    @reefrocks12 6 лет назад

    Hey, do you know what should I change if I want to paste these as values? I get #REF! error when I run this script. Kind regards

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hi +reefrøcks -- you'll want to change line 30 into two lines, the first "rngSrc.Copy" (copy the source range) and the second "rngDst.PasteSpecial xlPasteValues" (paste the data to the destination range as values)

  • @mohideenking2332
    @mohideenking2332 7 лет назад

    Hi Sir,
    I hope you are doing well.
    I have multiple excel file in different location with Password protection (Each Diffrent Password). End of the day i want to copy paste data in one master file. All file data Headers Same. Every time i have to enter password and open file for copy paste to Master file. Kindly help me out automated Macro VBA code for this.

  • @nielsmartinlund9612
    @nielsmartinlund9612 2 года назад

    Hi Dan! Thank you for great VBA videos! I have a question. The code is failing when I have data to the right in my paste sheet. The code then puts the data in the first date cell after my data to the right of the paste area. How should I change the the last occupied formula to only look at specific range?

  • @Jacobart28
    @Jacobart28 4 года назад

    Hi Sir. I copied the code from your website and edit the neccessary however, im getting an error "compile error: sub or function not defined"

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hi +Mary Jane are you absolutely sure you copied all the code? That error "sub or function not defined" means VBA is not recognizing a function which is generally an issue when you do not copy ALL the code (chances are you missed the functions at the very bottom) at danwagner.co/how-to-combine-data-from-multiple-sheets-into-a-single-sheet/

    • @binguyen3251
      @binguyen3251 4 года назад

      Have the same issue. It stops at lastoccupiedcolnuminrow

    • @DanWagnerco
      @DanWagnerco  4 года назад

      @@binguyen3251 are you absolutely, positively, 100% sure you copied every single line from the code at danwagner.co/how-to-combine-data-from-multiple-sheets-into-a-single-sheet/ ? There are two functions defined at the bottom, lines 43 through 85, that are vital to running this script, and if you did not copy them over then you will get an error message stating "Sub or Function not defined"

  • @jamesrosebery337
    @jamesrosebery337 6 лет назад

    Hey Dan, I am trying to copy your code but I am getting a compile error for lngDstLastRow = LastOccupiedRowNum(wksDst) As the system is saying it is not defined. Rest of code is copied as shown so I am not sure how to fix.

    • @dadidas07
      @dadidas07 6 лет назад

      hey James are you absolutely sure you copied all the code? that is a function that is defined at the bottom of the script - double-check the copy paste from the tutorial, could be as easy as some missed lines

    • @jamesrosebery337
      @jamesrosebery337 6 лет назад

      Thanks I found your online tutorial with the linked information from GITHUB.

  • @killerkuerbis6845
    @killerkuerbis6845 6 лет назад +1

    Hey,
    The whole copy-paste procedure loops twice, so i get double the data i actually want.
    Do you have any idea what i might have done wrong?
    The code is exactly the same as yours. Thanks.

    • @DanWagnerco
      @DanWagnerco  6 лет назад +1

      hey +Killer Kuerbis -- fascinating! that is literally the first time i've heard that the code is looping twice... in order to troubleshoot that condition, you should double-check the For Each wksSrc In ThisWorkbook.Worksheets loop with a Debug.Print statement as that defines the start and stop. if that is functioning correctly, you need to double-check the code inside the loop, as you may be executing the copy and paste twice

    • @killerkuerbis6845
      @killerkuerbis6845 6 лет назад +1

      Dan Wagner thanks for being so active here. I fixed one problem by just looking at your answers here.
      Thanks for now, i'll check the loop again.

    • @killerkuerbis6845
      @killerkuerbis6845 6 лет назад +1

      Dan Wagner actually after some debugging the problem was gone. No idea why it works now, classic programming.

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      isn't it so weird how that happens +Killer Kuerbis haha?! happy to hear that you have it sorted out :)

  • @muthukumaran-lq3rf
    @muthukumaran-lq3rf 7 лет назад

    Dan, Please let me know the basic code to run macros on shared workbooks.
    i have just google a code for auto save the shared workbook every 5 mins and after sharing enabled seems to be macro is missing from workbook.

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      hi +muthu kumaran I don't have the answer to your question, in general I would strongly suggest using Excel 2016's built-in Auto Save functionality instead of attempting to write a macro

  • @vadimbrs
    @vadimbrs 8 лет назад +1

    hi dan,
    if i have two sheets but different columns
    for example
    one sheet(amount, price, name)
    sheet two(amount, date, note)
    how cam i marge this two with macro
    thanx

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Heya +Vadim br -- merging two sheets with different headers is very doable. However, you have to decide how you would like them to be merged -- do you want to maintain all of the columns?

    • @vadimbrs
      @vadimbrs 8 лет назад

      yes

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hey +Vadim brs! I tackled this challenge (where columns are out-of-order) here:
      danwagner.co/how-to-combine-data-from-multiple-sheets-into-a-single-sheet-but-different-columns/
      Here's a link to the video guide:
      danwagner.co/screencast-combine-sheets-with-different-columns

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Howdy +Vadim brs -- apologies, the last comment has the incorrect link. This should do:
      Tutorial: danwagner.co/how-to-combine-data-with-different-columns-on-multiple-sheets-into-a-single-sheet/
      RUclips: danwagner.co/screencast-combine-sheets-with-different-columns
      Thanks!

  • @cool.danny0075
    @cool.danny0075 6 лет назад

    Hi dan,
    Daniel here what an amazing video to learn from.
    I have an issue though the data inputs in my case are filtered after excluding some rows but all my input sheets are having same columns but then after filtering about 21 sheets my range in each sheets differs can please help me getting a workaround for this as I want to combine the filtered data to a summary sheet.

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hi +cool.danny 007 -- you can adjust the rngSrc variable in this code to instead use the Offset logic defined in this tutorial on line 31: danwagner.co/how-to-delete-rows-with-range-autofilter/ except you do NOT want to delete, you want to copy :)

  • @hahagang1
    @hahagang1 6 лет назад

    Hi Dan,
    The code is very good. After combined in the import sheet, could there be a column that can show can show the initial data sheet name for references ?
    i.e. New Column in the import sheet listed the sheet name of their initial source of the information.

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hiya +Win Tong Lim -- yes, this is possible! You can use the technique on lines 93-119 in this tutorial to accomplish that: danwagner.co/how-to-combine-multiple-excel-workbooks-into-one-worksheet-with-vba/

  • @rochellefelipe8794
    @rochellefelipe8794 7 лет назад

    Hi This is very helpful! I'm running into an issue where the macro is ignoring my last occupied column and only taking the column before the last one. The src ends on column X but the macro only copies through column W. Also, some sheets don't have data in column X as this is a variable column. HELP PLEASE!

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Hey +Rochelle Felipe -- this script only calculates the last column once, so I'm guessing that the first sheet does NOT have data in column X (so it thinks the last column is always W). This tutorial handles situations like yours, where the columns may vary: danwagner.co/how-to-combine-data-with-different-columns-on-multiple-sheets-into-a-single-sheet/

  • @vikramkanda757
    @vikramkanda757 3 года назад

    How do you limit to only 4 columns even if you have more occupied columns?

    • @DanWagnerco
      @DanWagnerco  3 года назад

      Hey +Vikram Kanda if you only need 4 columns, I would suggest copying all the data over (like the tutorial) then deleting the columns you do not need at the end of the script

  • @daringwrinchester
    @daringwrinchester 6 лет назад

    if on a given table there are empty cells throughout various columns/rows (and we want to keep it as it is), how would you overcome the issue of the code stopping as soon as it reaches the first empty cell?

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hi +daringwrinchester -- the code as-written should find the very last occupied cells both in the X and Y directions, then copy the ENTIRE range, leaving your empty cells intact. if it is not doing that, something is majorly wrong! what happens when you run the code as-is?

  • @HueyPNewton
    @HueyPNewton 4 года назад

    It's only copying the first row of every sheet for me. Any ideas on what might be happening? I am trying to copy multiple tables to a master sheet.

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hey +Chris Poulos -- if the script is only copying the first row, that means lngSrcLastRow = LastOccupiedRowNum(wksSrc) is 1 which is very strange, I suggest adding break points and examining that variable as you loop through each Sheet to see why lngSrcLastRow is equal to 1 each time

    • @HueyPNewton
      @HueyPNewton 4 года назад

      @@DanWagnerco My apologies, it is copying the first column from each sheet.

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Chris Poulos OK awesome, when only the first column is copied that probably means the first Sheet being examined is empty, so the last column variable is set to 1. Look for an empty Sheet in your file and remove it OR make sure you’re skipping that Sheet in the loop

    • @HueyPNewton
      @HueyPNewton 4 года назад

      @@DanWagnerco It worked! Thank you so much for the prompt response. Great code.

  • @riansutarsa660
    @riansutarsa660 4 года назад

    thank you sir this is what I'm looking for, I have question is what if there are several sheets that I don't want to combine

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hey @Rian Sutarsa great question! You can use an If statement to check the Sheet names and determine whether or not you want to combine that Sheet like I show in this tutorial: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/

  • @JJWYT
    @JJWYT 8 лет назад

    Hi Dan,
    This is awesome! So helpful for a newbie. I was wondering if there is an easy way to specify the sheets I wanted rather than looping through all sheets. I have a workbook with 8 tabs or so but need to do this with just 4 of the tabs. Again thank you so much for this video.

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hey Jackson -- great question.
      If you only want to combine 4 specific tabs (amongst many), you'll need to tweak line 22 in this macro (which is available here: gist.github.com/danwagnerco/040402917376969bf362).
      Rather than skipping the "Import" sheet, which is accomplished on line 22 by If wksSrc.Name "Import" Then, you'll instead want to verify that the name matches one of your sheet names by using "=" and "or":
      If wksSrc.Name = "SheetYouWantToImport1" Or _
      wksSrc.Name = "SheetYouWantToImport2" Or _
      wksSrc.Name = "SheetYouWantToImport3" Or _
      wksSrc.Name = "SheetYouWantToImport4" Then

    • @JJWYT
      @JJWYT 8 лет назад

      Worked perfectly. Thank you so much for the help!

    • @toma7491
      @toma7491 6 лет назад

      Hi Dan. I've 'borrowed' your VBA with line 22 amended so that it only picks up nominated sheets and it works perfectly. With my very limited VBA knowledge how would I need to amend the VBA to (a) clear the records on the 'Import' sheet (except headers) every time I run the VBA, i.e. I don't want to append the data on the 'Import' sheet but start with a clean sheet every time the VBA runs? and (b) how can I nominate a different starting column on the 'Import sheet', i.e. my source sheets all have columns A to D but in my destination sheet ('Import') the data needs to go into columns H to K?

    • @javalearner4227
      @javalearner4227 4 года назад

      @@DanWagnerco Hi Dan! Thanks for sharing this code but I have changed the formula with (=) sign. However, its only copying the first column. what should be done next to copy the and paste the all columns in source_sheet?

    • @DanWagnerco
      @DanWagnerco  4 года назад

      @@javalearner4227 If the script is only copying a single column, that means it is probably starting on a blank Sheet and calculating that the last-occupied column is 1. I suggest removing the (probably) empty Sheet or skipping it -- thanks!

  • @berniereyes4567
    @berniereyes4567 8 лет назад +1

    Hello Dan,I keep getting the message below: Run-Time Error '9':Subscript out of rangeVB highlights line 11:Set wksDst = ThisWorkbook.Worksheets("Import")not sure if anyone else got this error. It is clearly within range but not sure what is going on.

    • @berniereyes4567
      @berniereyes4567 8 лет назад +1

      Found the issue... I was loading the code into PERSONAL.XLSB since I wanted to use into any open workbook but since the code is defined to one particular workbook I was getting the out of range message....
      anyone encountering this same issue... if you want to use this code to any open workbook simply set the ("Import") to ("Sheet1") and make sure the entire code is in the PERSONAL.XLSB. and do not change the title of the sheet until after you're done running the macros.
      if there's a better and easier way please post.

    • @DanWagnerco
      @DanWagnerco  8 лет назад +1

      Heya +Bernardo Reyes -- awesome detective work!
      Since you'd like this code to reside in your personal.xlsb, "ThisWorkbook" will no longer be the target of all the operations -- the source of the problem, as you accurately identified.
      If you are 100% sure that you will only execute this code on active workbooks that need combining, you could change "ThisWorkbook" to "ActiveWorkbook" and make sure the destination Sheet name is set appropriately (since it probably will not be "Import").
      Hope that helps!

  • @paulhaslam3831
    @paulhaslam3831 3 года назад

    Doesn't work me, copied your code nd gets stuck at "LastOccupiedRowNum", comes back with Sub or Function not Defined

    • @DanWagnerco
      @DanWagnerco  3 года назад

      Hi +Paul Haslam, are you absolutely certain you copied all the code? LastOccupiedRowNum is a function defined at the very bottom

  • @kadu190578
    @kadu190578 4 года назад

    Hello Dan, Superb Video, Thanks a lot for the same.
    I would like to skip one more worksheet with name "Data"
    How can I do that

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hi +Nilesh Kadu you can follow this tutorial to see how to skip certain Sheets but not others when combining data: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/

  • @preludefugue4859
    @preludefugue4859 7 лет назад

    Hi Dan, If I only want to copy the data start from sheet #3 to the last sheet (the # of last sheet is varied in each file)... what should I do? Thank you.

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Hiya +Prelude Fugue, I'm sure this challenge can be handled, but I need to know a bit more about the problem at hand. Are the sheets named the same way, like "Sheet3", "Sheet4", "Sheet5", ... "SheetX"?

    • @preludefugue4859
      @preludefugue4859 7 лет назад

      Hi Dan, thank you for your reply!! The name in those sheets are different... We created these workbook for tracking Department sales. so each department has its own tabs..... Also each workbook might have varied number of tabs depends on how many departments in that locations.. The only commend thing is... I only need to copy the data start from the 3rd sheets (count from left) since the first 2 sheets are not department sales........also the columns and columns heads(row1) in these Department sales sheets are exactly same... When I copy these department sales into a "summary sheet", I wish to copy the formula as well, so if I update any of these sheet, the summary sheet will also be updated..... Is these possible ??/ I am so new to Macro and totally lost

    • @DanWagnerco
      @DanWagnerco  7 лет назад +1

      Hey +Prelude Fugue, totally possible and this situation is not that uncommon. It sounds like you need to skip the first 2 sheets, and they are pretty well-known... if you know the names of the 2 sheets, you can use the strategy in this tutorial: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/

  • @Harijs2011
    @Harijs2011 3 года назад

    Code doesnt work- in debug shows that LastOccupiedRowNum is not defined

    • @DanWagnerco
      @DanWagnerco  3 года назад

      Hey +Harijs Osis -- LastOccupiedRowNum is a function defined at the bottom of the code in the tutorial, are you absolutely certain that you copied EVERYTHING? Here is a direct link, do you still get the error when you copy all the code (from line 1 through line 85)? danwagner.co/how-to-combine-data-from-multiple-sheets-into-a-single-sheet/

  • @changalbert
    @changalbert 8 лет назад

    Hey Dan,
    How do you paste values instead of past formulas? Thanks!!

    • @changalbert
      @changalbert 8 лет назад

      NM figured it out. You change the copy destination to:
      rngSrc.Copy
      rngDst.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hey Albert -- excellent q!
      (Please pardon any typos as this comment is coming from a phone)
      You'll need to tweak line 30 into two lines:
      rngSrc.Copy
      rngDst.PasteSpecial xlPasteValues
      That should do the trick!

    • @changalbert
      @changalbert 8 лет назад

      +Dan Wagner thanks dude

  • @bstjean20
    @bstjean20 7 лет назад

    This video is great! How can I have it only pull in the data if column A has an "X" or "Y"?

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      hi +Brenson Saint Jean I would use the Range.AutoFilter method, this tutorial covers that method in the context of deleting rows (but it's the same concept): danwagner.co/how-to-delete-rows-with-range-autofilter/

  • @vipinsahu8580
    @vipinsahu8580 4 года назад

    Dell Dan! I have unstructured data (data in different column) in the multiple excel tabs and I want to merge the data in one sheet.

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hey +Vipin Sahu this tutorial explains how to combine data from multiple Sheets into a single Sheet even when the columns are out of order: danwagner.co/how-to-combine-data-with-different-columns-on-multiple-sheets-into-a-single-sheet/

  • @ashleytownsend4838
    @ashleytownsend4838 6 лет назад +1

    I've applied this to my workbook and ran into a few small issues, but i'm stuck at 3). Can you help please?
    1) Firstly, I wanted this script to only target sheet names containing "CDK" within my workbook
    'Loop through all sheets
    For Each wksSrc In ThisWorkbook.Worksheets
    If wksSrc.Name Like "CDK*" Then
    2) Secondly, I wanted the script to paste values the destination sheet only
    'Store the source data then copy it to the destination range
    With wksSrc
    Set rngSrc = .Range(.Cells(2, 1), .Cells(lngSrcLastRow, lngLastCol))
    rngSrc.Copy
    rngDst.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
    End With
    3) Thirdly and most importantly, the script is only pasting column A of my source sheets to column A of my destination sheet. My source sheets contain 7 columns worth of data...

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hi +Ashley Townsend -- for your first question, you want to use InStr to check for "CDK" in the Worksheet name. Here's an example: stackoverflow.com/a/15585089/3075291

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hey +Ashley Townsend -- also for your first question, here's a tutorial I wrote on combining certain Sheets but not others: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hello +Ashley Townsend -- this script calculates the last occupied column based on your "Import" Sheet, which I am assuming is empty in your case (meaning that the function returns a 1) but in this example, the "Import" Sheet already has headers, meaning that the last-occupied column calculates correctly. To fix this you should either add headers to your "Import" Sheet or calculate the last occupied column from the first Sheet that actually contains data

    • @ashleytownsend4838
      @ashleytownsend4838 6 лет назад

      Thanks for the really quick replies...!
      I failed to mention that i'm a VBA newb.
      Both of my import sheets that I'm testing this on aren't empty, they both contain data from Columns A:G

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      Interesting +Ashley Townsend -- so what is the value of lngLastCol?

  • @marcuskay8267
    @marcuskay8267 8 лет назад

    this is great, Dan.
    How can i get this to skip different sheets?

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hiya +Marcus Kay -- this ought to help:
      danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/
      Good luck and don't hesitate to holler at your boy if you have any additional questions,
      Dan

    • @marcuskay8267
      @marcuskay8267 8 лет назад

      it really does! Thanks again!

  • @eamonmccourt8251
    @eamonmccourt8251 5 лет назад

    When I run the module, it only grabs info from the first column and nothing else, it gets each worksheet but only column 1?

    • @DanWagnerco
      @DanWagnerco  5 лет назад +1

      Hi +Eamon McCourt -- that happens when your "Import" Sheet is left blank, forcing the lngLastCol value to 1. To fix this you'll either want to (1) drop the headers into your "Import" Sheet like I do in this example by hand or (2) modify the code to calculate the last-occupied column on the first data Sheet

    • @eamonmccourt8251
      @eamonmccourt8251 5 лет назад

      Dan Wagner makes perfect sense now, for the life of me, I couldn’t figure it out.
      Thank You!

  • @Zach9208
    @Zach9208 7 лет назад

    Will this work when each sheet has extra columns. I want to look at copying all columns from multiple workbooks/sheets over wherever each column matches.

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      hi +Zach Clement no this tutorial assumes that all sheets have the same column order, this tutorial handles out-of-order and additional columns: danwagner.co/how-to-combine-data-with-different-columns-on-multiple-sheets-into-a-single-sheet/

    • @Zach9208
      @Zach9208 7 лет назад

      Dan Wagner I am looking for a macro code that can copy columns that match based on the destination workbook. It is key that I paste this data to existing placeholder columns in my destination workbook . I also need the macro to loop and do this for several different worksheets that have differing column name combinations. Note: all of the columns of the columns I want copied over are in the destination workbook already.The unique thing is my destination file has a placeholder for all of the differing worksheet column name combinations. I cannot seem to find a macro anywhere on the internet that does this function. The macro would need to sense where data stops in the destination workbook so it can paste the next.

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      heya +Zach Clement -- fascinating and well-described! I have not written a tutorial on that exact case, but it can absolutely be done. I'm testing out a handful of packaged services that might be interesting to you, email me at dan@danwagner.co if you'd like to discuss further

  • @jpaez82
    @jpaez82 8 лет назад

    hey Dan how do you allow for duplicates or does it automatically? and how do add tabs to skip? thanx

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      +DigitalErra Hiya DigitalErra -- in the code used for this video, duplicates are allowed. Do you need to remove duplicates? As far as skipping tabs goes, you can check names in the For Each wksSrc In ThisWorkbook.Worksheets loop. Is skipping tabs something you need to do often?

    • @jpaez82
      @jpaez82 8 лет назад

      +Dan Wagner I would have charts and other data that will not need to be copied over. I would need columns A-M to be copied, and 31 tabs to represent everyday of the month all at various lengths. I could send you over the sheet that I will use daily.

  • @shannonryan8527
    @shannonryan8527 4 года назад

    Hi Dan! this was extraordinarily helpful. QQ - I have a LARGE workbook, over 40 tabs. I need to combine 3. How can I amend so that instead of saying EXCLUDE these 37 tabs, I can ask it to INCLUDE only these 3 named sheets. Thanks in advance.
    'the names we know we DO NOT want to combine into ALPHA
    For Each wks In ThisWorkbook.Worksheets

    'If this sheet name is NOT one that we want to ignore,
    'append the data to the ALPHA sheet
    strName = UCase(wks.Name)
    If strName "Sheet1" And _
    strName "Sheet2" And _
    strName "Sheet3" And _ ........ to Sheet 44

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hey +Shannon Ryan, in this case you will instead want to use strName = "WhateverName1" Or strName = "WhateverName2" Or strName = "WhateverName3". Thanks! -Dan

    • @shannonryan8527
      @shannonryan8527 4 года назад

      @@DanWagnerco thank you so much for taking the time to reply! This worked perfect :)

  • @dasrotrad
    @dasrotrad 7 лет назад

    In my workbook, the macro stops at line Set wksDst.. with the error message Run-time error '9'; Subscript out of range.
    I have named a blank sheet "Import" Any idea what is wrong?
    Thank you.

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Hey +robert cline -- is the "Import" worksheet inside the Workbook that you are running the macro from? That's what ThisWorkbook.Worksheets("Import") is assigning

    • @dasrotrad
      @dasrotrad 7 лет назад

      Yes. The "import" worksheet is inside of the same workbook with all other sheets.
      ..and the vba code.

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      That's a puzzler +robert cline, I can't troubleshoot further without looking at the file. Can you send it to me? My email is at the bottom of that article

    • @dasrotrad
      @dasrotrad 7 лет назад

      I have 18 columns. Column A to R. On some sheets, there are two blank columns then a pivot table in column/row T1 on the same sheet. Could that be the issue?

    • @dasrotrad
      @dasrotrad 7 лет назад

      Since you responded to Rochelle that the code only computes the columns once, I places a sheet with only columns A-R and no other data as the first sheet after "Import" sheet.

  • @latesh2010
    @latesh2010 8 лет назад

    I am very new to VB and i don't know much. But using your video i tried combining data into one. But i got a message saying sub or function not defined. Please help me solve the issue

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hiya +latesh shetty -- not to worry, I think I know what the problem is.
      Did you definitely copy all of the code from the example write-up in the linked tutorial? Here is a link to that code direct:
      gist.github.com/danwagnerco/040402917376969bf362
      It is possible that you missed one or both of the functions defined and implemented at the bottom ("LastOccupiedRowNum" and / or "LastOccupiedColNum").

    • @latesh2010
      @latesh2010 8 лет назад

      Thank you so much Dan and you were right i missed couple of lines. Let me try using this

  • @chumanying9095
    @chumanying9095 7 лет назад

    Hi Dan, How can I link the import sheet to the source? Can the new inserted data be shown in the import sheet? How can i do that too? Please help!

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      hi +Man Ying Chu -- I am afraid I do not understand your questions. Can you clarify?

    • @chumanying9095
      @chumanying9095 7 лет назад

      Can I synchronize the import sheet and source sheet? which means I want to keep inputing new data into source sheet and I want the new data shows in the import sheet too

  • @laurenhenderson9382
    @laurenhenderson9382 8 лет назад

    Hi Dan! Thanks for this! Its super helpful! 2 questions. How can I set it up so that's its checking every sheet except for 1 sheet?How can I restrict the range in each sheet that its looking to? I want it to pull data from a smaller range of rows.

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hiya +Lauren Henderson!
      (1) Here's a tutorial I wrote about combining certain sheets, but not others: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/
      Of course, if you'd prefer to go straight to the video, it's here: ruclips.net/video/ZRKk2XHwUX4/видео.html
      (2) Can you tell me more about the range on each sheet? Is it always the same?

    • @laurenhenderson9382
      @laurenhenderson9382 8 лет назад

      Hi Dan,
      The range is always the same. I have 10 or so sheets with 2 separate tables that each client fills out, and I need to extract the data from only one table onto a summary sheet,

    • @DanWagnerco
      @DanWagnerco  8 лет назад +1

      Hey +Lauren Henderson -- cool, that is very doable!
      You'll want to change line 29 to be something like:
      Set rngSrc = .Range("A1:G20")
      where your well-defined Range can be any start / stop cells (like "B5:C10", "Z1:AA3", etc.)

    • @laurenhenderson9382
      @laurenhenderson9382 8 лет назад

      Awesome! That helps a ton.
      What is the code I would use in order to get the macro to skip all rows from the table that are blank.
      I want it to extract any row of data that has at least one cell filled in from the table. And I want it to skip any rows that have all empty cells.

    • @DanWagnerco
      @DanWagnerco  8 лет назад

      Hey +Lauren Henderson -- that's a great question, and something I hope to answer soon with a new article and tutorial!

  • @Tarus01
    @Tarus01 6 лет назад

    Hello sir
    I am Tushar Sharma from Kanpur
    I want create a master of ms excel. I have workbook having 500 sheet.
    I want to prepare a list of headings with thier values
    I am unable to use VBA coding
    By cut copy paste its hue stuff and time taking.
    By dragging sheet no. Not increasing except cell no increased.
    Example : =sheet1! B1
    By dragging :=sheet1! B2
    I want : =sheet2! B1
    So please help me

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hi +tushar sharma i'm afraid i do not understand your question...

  • @kanmanichinnadurai7147
    @kanmanichinnadurai7147 5 лет назад

    Hello sir,
    Please tell me how to combine the sheet 1 datas from multiple files into single excel sheet of master workbook.

    • @DanWagnerco
      @DanWagnerco  5 лет назад

      Hi +kanmani chinnadurai -- please follow this tutorial to combine Sheets from multiple Workbooks into a single file: danwagner.co/how-to-combine-multiple-excel-workbooks-into-one-worksheet-with-vba/

  • @jeffreypritchard6102
    @jeffreypritchard6102 8 лет назад +1

    Dan,
    I emailed you, but thought I would ask my question here too. What if the only information I want to copy is in cells A4:V4 on thirty different sheets?

    • @lisu5803
      @lisu5803 7 лет назад

      Yeah, I have same problems. Hope Dan could help on that.

    • @hahagang1
      @hahagang1 6 лет назад

      Hi there, I have the same problem.
      this can be resolve by checking this line 29 where "Set rngSrc = .Range(.Cells(2, 1), .Cells(lngSrcLastRow, lngLastCol))"
      The above has set the range base on the predefined rules i.e cells that contain data.
      But to set the copy area as A4:V4, it would be read as "Set rngSrc = .Range(.Cells(4, 1), .Cells(4,22))"
      Hope this help.

    • @alexallen2529
      @alexallen2529 6 лет назад

      Hi, I have a similar problem is there a way of moving the copy range one column across example C21:F40 and excluded two sheets instead of just one?

    • @DanWagnerco
      @DanWagnerco  6 лет назад +1

      hi +Alex Allen this tutorial explains how to skip more than one Sheet: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      heya +Alex Allen you can modify lines 28-31 to just copy a specific Range (like C21:F40) rather than calculating the last row each time

  • @krishnajagadeesh6307
    @krishnajagadeesh6307 4 года назад

    How to get the vba code sir

    • @DanWagnerco
      @DanWagnerco  4 года назад

      Hi +KRISHNA JAGADEESH you can get the VBA code from the first link in the description which points to the tutorial here: danwagner.co/how-to-combine-data-from-multiple-sheets-into-a-single-sheet/

  • @muthukumaran-lq3rf
    @muthukumaran-lq3rf 7 лет назад

    Hi how do skip few sheets. I have some 13 sheets i need to copy data from only 10 sheets.

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      hi +muthu kumaran I wrote a tutorial on doing that here: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/

    • @muthukumaran-lq3rf
      @muthukumaran-lq3rf 7 лет назад

      Thank you Dan

  • @chrissylynch7380
    @chrissylynch7380 7 лет назад

    Hi! is there a way to insert some line of code to insert index match or static commands? for instance i would want to insert a date in column A based on the date on that worksheet. Thanks!

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Hey +Chrissy Lynch -- I'm not sure I understand your question. Do you want to add columns to the resulting combined data? Or into the source data on the individual sheets?

    • @chrissylynch7380
      @chrissylynch7380 7 лет назад

      Dan Wagner I want to add data to the combined results tab. so for instance I would insert a date in column a and the word lunch in column c and column b would be what was copied from the individual tab. I hope that makes more sense. thank you!

  • @mithunjan18
    @mithunjan18 7 лет назад

    Great work.... is it possible to skip a sheet from the excel workbook

    • @DanWagnerco
      @DanWagnerco  7 лет назад +1

      hey +mithun nair -- yes, you can skip sheets by following the tutorial here: danwagner.co/how-to-combine-data-from-certain-sheets-but-not-others-into-a-single-sheet/

    • @mithunjan18
      @mithunjan18 7 лет назад

      Dan Wagner - ha thanks for such a quick reply... i am very much new to this .. let me go through it and will get back to you if i had any doubt ... thanks and good luck

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      all good +mithun nair, that tutorial should get you where you need to go!

    • @mithunjan18
      @mithunjan18 7 лет назад

      Ha Dan Wagner it worked for me in a different way... I used ur 2nd macro it started skipping unwanted sheets as expected but not combining all the sheets to one excel.. then I pick up 'strName' into old macro and it worked successfully well but, a small issue is that it copy the header again which is getting duplicated in the master sheet... I added a 'selection.delete' into it just before 'MsgBox' and it actually not the right approach but it's working as of now. But let me know if we can stop this by modifying the macro
      Now one more issue is that, if I run the macro again or I hit it twice accedently, it will copy the data from other sheets again into master sheet creating doubling all the data. And create duplicates .... Will u be able to help me on this.. So that there will be some mechanism to prevent the data from duplicating

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Hi +mithun nair -- I'm not sure exactly why you are getting multiple headers as I cannot see your code, but in general you can avoid header copying in a loop by using a strategy like lines 60-62 from this link: gist.github.com/danwagnerco/a5be4bd8e4843533a096f9ab91bcb3ed#file-combinemanyworkbooksintooneworksheet-vb

  • @trapham7769
    @trapham7769 7 лет назад

    Hi Dan,
    I copied your code but for some reasons, it only added into 1 col with 2 rooms :/
    Thanks!

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Hi +Tra Pham -- if it only copies 1 column, the issue is almost certainly that lngLastCol (variable) is not getting correctly calculated. Do you need to skip certain worksheets, or is there perhaps a hidden worksheet that is empty?

  • @cfavinaychhaparia268
    @cfavinaychhaparia268 6 лет назад +1

    Thanks A lot Dan, really helped me a lot.

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      hey +CFA Vinay Chhaparia happy to help!

  • @sallyleanzy8888
    @sallyleanzy8888 4 года назад

    thank you so much. It worked perfectly.

  • @lucuid81
    @lucuid81 5 лет назад +1

    thanks so much for VBA script :)

  • @fazalwahab11
    @fazalwahab11 5 лет назад

    Wowoo! this worked like a rocket. Thank you so much

    • @rukshik
      @rukshik 3 года назад

      Can u share the VBA CODE pls

  • @miguelate
    @miguelate 7 лет назад

    I want to copy all the data from several worksheets to a master worksheet. Let's say an individual worksheet will have data in only 3 columns name, possible points and total points. Another worksheet will have the same column names and many more. I want all these information no merged but displayed individually but on the same master worksheet. So the master sheet will have all teams separately displaying all the information next to each other to compare. 1st showing the first worksheet and next the 2nd worksheet data. I hope it makes sense. I have found videos on how to merge, consolidate, get ranges, etc... but I haven't found anything to do what I'm trying to do. If it's done automatically it would be best. A different person will be adding information to each worksheet and all the data from all the worksheets should be automatically updated to the main worksheet to see all groups next to each other and compare. This is for a competition. is VBA the only way to accomplish this?

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Hey +Miguel Angel Torres Espinoza -- you can use this strategy to copy all columns from all sheets, one on top of the other, with columns matched where appropriate:
      Tutorial: danwagner.co/how-to-combine-data-with-different-columns-on-multiple-sheets-into-a-single-sheet/
      Screencast on RUclips: danwagner.co/screencast-combine-sheets-with-different-columns

    • @miguelate
      @miguelate 7 лет назад

      thanks, I will try it. Although, I think it would be more efficient to add them next to each other because each worksheet only has 3 columns and i would be able to see all the teams without having to scroll down. I could just use one worksheet are and see all the teams at the same time. is that possible?

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Hey +Miguel Angel Torres Espinoza -- I thought all the sheets had different columns?

    • @miguelate
      @miguelate 7 лет назад

      Each worksheet has 3 columns: name, possible points and total points. I'm using column A for numbers 1-100 and column B,C, and D for the data. I want to be able to displayed the data from each team on one main worksheet next to each other. I could use columns B,C,D for one team and leave a space and next F,G,H for second team, etc... up to 20 teams so I can compare scores. Is it possible to transfer data from columns B,C,D to other letters?
      Example: team 1 columns A,B,C. Team 2 E,F,G team 3 H,I,J, etc...
      Does it make sense?

    • @miguelate
      @miguelate 7 лет назад

      Hi +Dan Wagner. Thanks for the tutorial but it combines the data. I don't need to combine the data. I just need to display the data from all worksheets next to each other to compare them. I want to be able to see all teams together from left to right but not combined. someone will be inputing data in every single worksheet. All the data from all teams "single worksheets with only 3 columns" should appear all together on the main worksheet as mentioned before. Not combined, not merged, not consolidated. Just displayed exactly as they are next to each other to compare them. I tried creating a link but once I uploaded to dropbox there's a message that says that the browsers don't support links and are disables. It only works in my mac. I'm trying to do somehting that will work permanently even if i share the file in dropbox to be update by other people and update automatically on the main worksheet will all the results from all teams to get the scores for all the teams. I hope it makes sense.

  • @DavidGarcia-wg5yh
    @DavidGarcia-wg5yh 6 лет назад

    so helpful!

  • @lisu5803
    @lisu5803 8 лет назад

    Go helpful, thank you very much

    • @DanWagnerco
      @DanWagnerco  7 лет назад

      Really appreciate the kind words +Li Su!

    • @lisu5803
      @lisu5803 7 лет назад

      Hi Dan,
      I sent an email to you for my special case. Could you kindly help on that?
      Thanks.
      Li

  • @amalradwan7193
    @amalradwan7193 6 лет назад

    u saved me . Thanks

    • @DanWagnerco
      @DanWagnerco  6 лет назад

      great +Amal Radwan, happy to help!

  • @mdshaw3135
    @mdshaw3135 6 лет назад

    great, Thanks

  • @paulhaslam3831
    @paulhaslam3831 3 года назад

    Doesn't work me, copied your code and gets stuck at "LastOccupiedRowNum", comes back with Sub or Function not Defined

    • @DanWagnerco
      @DanWagnerco  3 года назад

      HI +Paul Haslam, are you absolutely certain that you copied all of the code? That error occurs when LastOccupiedRowNum, which is a function defined at the very bottom of the code, is not copied over

    • @paulhaslam3831
      @paulhaslam3831 3 года назад

      @@DanWagnerco Yes, copied from your link, I even slimmed down the example to only copy sheets of data and keep the names of the sheets as one word

    • @paulhaslam3831
      @paulhaslam3831 3 года назад

      Set rngSrc = .Range(.Cells(2, 1), .Cells(lngSrcLastRow, lngLastCol))
      rngSrc.Copy Destination:=rngDst - this piece of code looks at little weird to me, but I am no expert. commas followed by dots?