+ Reply to Thread
Results 1 to 11 of 11

Autfiltering, copy to another sheet then concatenate to a master sheet

  1. #1
    Registered User
    Join Date
    08-13-2013
    Location
    Wakefield, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Red face Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi everyone,
    I'm very new to VB and would like some pointers.
    I have a series of spread sheets that are amended by others,
    What I've been tasked to do is to bring together all of the common cells and display them on a master sheet.
    Basically there are 4 sheets for each row, each with 54 rows and 27 possible locations and 19 rows per area and a total of 4 areas.
    I have been searching the forums and found various bits of code the just about do the task but I feel it is a bit clumsy
    I've been trying to work it with loops but keep flying off into oblivion,
    Any help would be appreciated.

    I have attached my working sheet, Autofilter MKII
    The tabs are as follows
    Row 1: Brings together the info from the active sheets, I've use Concatenate on the original sheets as the data is across 5 columns,
    Work Area: I use to copy too after 'Autofilter' then Concatenate into 1 cell copy that to the side then repeat 27 times
    Master: This is the desired 'Front Sheet' this just copies from 'Work Area'

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi, boris55,

    sorry but I canīt see an attachment in this thread (and I think it would be helpfull indeed).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    08-13-2013
    Location
    Wakefield, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi, Holger,

    I have managed to attach the file now,
    Thanks for the update.

    Boris
    Attached Files Attached Files

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi, Boris,

    sorry but the code supplied wonīt find any values to copy from Sheets("Row 1") to Sheets("Work Area"), and I doubt it to be a good idea to use formulae in Sheets("Master") which refer only to that sheet all by themselves. In short:; as you have done some work to the sheet sfrom the other workbooks I canīt figure out how the original data looks like nor how it should be put into Sheets("Master") (okay, I have an idea about what it might turn out to be).

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    08-13-2013
    Location
    Wakefield, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi Holger,

    I am very sorry for wasting your time, I tried to smarten up the sheet to make it easier to understand, what I forgot to do was change all the references in the sheet.
    I have done this now and re-attached it as 'Autofilter MIII.zip'

    Regards
    Boris
    Attached Files Attached Files

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi, Boris,

    as your sample shows the formulas on Sheet Master leading toi that sheet - what about the code her? I assumed that the results need to be inserted into COlumn B on Master (made up by the constant clngCOLUMN):

    Please Login or Register  to view this content.
    Ciao,
    Holger

  7. #7
    Registered User
    Join Date
    08-13-2013
    Location
    Wakefield, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi Holger,
    I am beginning to see why you are a Forum Guru.... you have managed to streamline my clumsy attempt, I have been trying to expand your code to work on 19 columns, all in the same format as column 'A' but I'm getting some strange results. Is it a case of putting the routine into another loop?

    Regards

    Boris

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi, Boris,

    as I didnīt see the criteria for choosing the column so I set a constant for this (Const clngCOLUMN As Long = 2) assuming this was all to be filled in into the first available Column on Sheet Master. If you want a loop you must enter a variable for the constant and change the value for it if a new one should be used (thatīs exactly where I had problems finding out).

    Ciao,
    Holger

  9. #9
    Registered User
    Join Date
    08-13-2013
    Location
    Wakefield, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi Holger,
    I have amended your code but I am struggling to change where it looks for the data, it works to a degree but only copies column A to all other columns.
    I have put a full set of data in ' Data Hall 1' of the attached spread sheet (101)
    I tested it on 'Row 2' sheet and found if there's no result, i.e. row 13 & 15, it puts the column header in there, can this be avoided?
    Attached Files Attached Files

  10. #10
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi, Boris,

    maybe try this amended code taking care of the fact that there must a row of data (not only the header row):

    Please Login or Register  to view this content.
    Ciao,
    Holger

  11. #11
    Registered User
    Join Date
    08-13-2013
    Location
    Wakefield, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Autfiltering, copy to another sheet then concatenate to a master sheet

    Hi Holger,

    You truly are a guru.
    Thanks very much, you have saved me a lot of searching and head scratching.

    Best regards

    Boris

+ 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] macro to auto copy data from multiple sheet to one master sheet
    By roger556 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2012, 01:52 AM
  2. Macro to copy data from one sheet to a master sheet with running totals
    By gmi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2012, 10:53 AM
  3. Macro to Look for Sheet, create if none, sort items from master & copy to new sheet.
    By ali.whitaker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-25-2012, 12:58 PM
  4. [SOLVED] Search for heading in data sheet and copy range to corresponding sheet in master workbook
    By sans in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-07-2012, 10:02 AM
  5. [SOLVED] How to copy data from master list sheet to another sheet based on category
    By nazrulfadzli in forum Excel General
    Replies: 2
    Last Post: 05-17-2012, 08:19 AM

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