Hello All,
I've clumsily tried to write a macro that will paste the information that is in column B of the sheet Adama 2018 to column A of the All Data Sorted Sheet. My end game is to somehow write the code to pull all the information from the
Hello All,
I've clumsily tried to write a macro that will paste the information that is in column B of the sheet Adama 2018 to column A of the All Data Sorted Sheet. My end game is to somehow write the code to pull all the information from the
Last edited by rcdavis28; 01-31-2018 at 01:30 PM. Reason: contained sensitive info. could not figure out how to delete posting.
The source sheets need to have a standard header layout to write a really efficient code. Otherwise you will likely have to write a separate routine for each source sheet to copy the data over. One way to do it would be to search for the source columns and use the return values to make an array for the columns to copy. You would also need a list or and array of the sheet names you want to copy from. It is clumsy, but it would work. The code below gives and example, but only uses three source sheets. You would need to expand the array to include all the sheets you want to copy from.
The code uses two arrays. One for the header titles and one for the worksheet objects. It also uses nested For loops with the outer loop controlling the workbook array and the inner loop controlling the header array. The inner loop will search for each header of the 'ALL DATA SORTED' sheet and if found will copy from row 2 and down of the source sheet to the next available row on the 'ALL DATA SORTER' sheet.![]()
Please Login or Register to view this content.
Last edited by JLGWhiz; 01-31-2018 at 01:01 PM.
Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
Just when I think I am smart, I learn something new!
rcdavis28, you use inconsistent filling in sheets. It is difficult to enumerate rows.
Example in worksheet 'DOW 18', column 'G'.
Methods "UsedRange", "CurrentRegion" and others may fail when calculating the number of rows.
Between the last row of an array/the table with data and the calculations below an array/the table should be a minimum 1 row of gap.
Columns on the contrary, here you have unnecessary breaks.
At least arrange the rows.
Last edited by mjr veverka; 01-31-2018 at 01:12 PM.
Thank you all!
Very similar macro, but here it search (in other sheets) what you type as the headlines in 'ALL DATA SORTED' sheet, and it copies only values.
If you organize rows in sheets correctly, the macro should be collecting data.
![]()
Please Login or Register to view this content.
Last edited by mjr veverka; 01-31-2018 at 02:51 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks