+ Reply to Thread
Results 1 to 7 of 7

vba copy specific columns with visible rows to another sheet

  1. #1
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    vba copy specific columns with visible rows to another sheet

    I have a subtotal for range of data (sheet name workings) , however need to copy specific columns with visible rows to another sheet called (summary ).
    See attached expected results of summary sheet in same workbook

    Looking for a vba code to copy to last data range to a new sheet in same workbook.

    The columns may vary as it depends on the worksheet , so the code should be modulable to adapt to any situation.
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: vba copy specific columns with visible rows to another sheet

    Will it always be columns from the last 7 columns? Will the headers be the same as your sample?

  3. #3
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: vba copy specific columns with visible rows to another sheet

    Quote Originally Posted by JOHN H. DAVIS View Post
    Will it always be columns from the last 7 columns? Will the headers be the same as your sample?
    No its a hardware template but for a food template after supp qty there are 3 add headers litres , sugar, alcohol making it 10 columns

    Then tarif description origin ,supp qty, litres sugar,alcohol ,extended ,,details to be copied to summary sheet

    Hope it helps

    See attached example
    Attached Images Attached Images
    Last edited by JEAN1972; 08-05-2016 at 12:45 PM.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: vba copy specific columns with visible rows to another sheet

    Can you attach a sample representing original data and Summary sheet layout?

  5. #5
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: vba copy specific columns with visible rows to another sheet

    Quote Originally Posted by JOHN H. DAVIS View Post
    Can you attach a sample representing original data and Summary sheet layout?
    See attached a food template
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: vba copy specific columns with visible rows to another sheet

    Maybe:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: vba copy specific columns with visible rows to another sheet

    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Please Login or Register  to view this content.
    Hi
    Tested,getting a run time error 9 subscript out of range
    at this line Set x = Sheets("Summary").Rows(1).Find(.Cells(1, i), lookat:=xlValues, LookIn:=xlWhole).
    Could you advise where I am going wrong .

    Regards
    Jean

+ 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: 0
    Last Post: 08-04-2016, 03:20 PM
  2. Replies: 1
    Last Post: 02-11-2015, 07:47 AM
  3. [SOLVED] Copy all visible rows on one sheet into columns on new (individual) sheets...
    By hambly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2014, 04:41 PM
  4. Replies: 0
    Last Post: 04-11-2013, 05:33 PM
  5. Replies: 8
    Last Post: 04-04-2013, 08:02 PM
  6. Replies: 5
    Last Post: 02-10-2013, 05:16 PM
  7. Use visible rows from autofilter to build Pivot table. Or use visible rows to Copy/Paste
    By mwhitedesigns in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 10:34 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