+ Reply to Thread
Results 1 to 6 of 6

VBA/Macro Save rows (based on criteria) as value to new sheet in closed workbook(s)...

  1. #1
    Registered User
    Join Date
    08-19-2015
    Location
    London, England
    MS-Off Ver
    365
    Posts
    67

    VBA/Macro Save rows (based on criteria) as value to new sheet in closed workbook(s)...

    Hi there,

    I've been struggling with this for a few days now, trying to remix several scripts into something that would fit my purpose. But as a total VBA noob, i'm really stuck and could use your help.

    Let me explain what the issue is...

    I've got a Workbook Source.XLS, sheetname Source with a list of employees (last, firstname) In Column A & B, defined by UK and BE in column C and several columns with info in columns >= D. The list starts on row 5.

    I'm looking for code that would copy (values only) the rows of the BE and UK employees into (closed) Workbooks BE.XLS and UK.XLS respectively, in a new sheet before existing sheets, where each new sheet would be named after a date in cell A1.

    All three sheets are in the same folder, and it would be sweet if something like ThisWorkbook.Path & "\BE" could be used, to prevent the macro from not working when someone else copies the folder.

    Your help would be appreciated very much
    Mike

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: VBA/Macro Save rows (based on criteria) as value to new sheet in closed workbook(s)...

    You need to open the workbook, add sheet, then copy based on the criteria and close it, saving the file. Then do the same thing for the second one.
    But without a sample file(with how the desired results should look) to test, probably nobody will bother to create something.
    Click the * to say thanks.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA/Macro Save rows (based on criteria) as value to new sheet in closed workbook(s)...

    Try something like this (not tested).

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    08-19-2015
    Location
    London, England
    MS-Off Ver
    365
    Posts
    67

    Re: VBA/Macro Save rows (based on criteria) as value to new sheet in closed workbook(s)...

    Thanks AlphaFrog, that worked Superb. Clean and what more, superfast within the blink of an eye. I'm really happy and impressed..!

    Is it possible to also copy the Headers I have on row 3 to BE.xls and UK.xls, as well as the formatting of the Source sheet. F.i. some columns have %, or additional formatting.

    Many thanks in advance...

  5. #5
    Registered User
    Join Date
    08-19-2015
    Location
    London, England
    MS-Off Ver
    365
    Posts
    67

    Re: VBA/Macro Save rows (based on criteria) as value to new sheet in closed workbook(s)...

    Thanks AlphaFrog, that worked Superb. Clean and what more, superfast within the blink of an eye. I'm really happy and impressed..!

    Is it possible to also copy the Headers I have on row 3 to BE.xls and UK.xls, as well as the formatting of the Source sheet. F.i. some columns have %, or additional formatting.

    Many thanks in advance...

    Doubel post, Sorry. Can't find a way to delete this post..
    Last edited by blak9; 10-02-2019 at 06:16 AM. Reason: Double post...

  6. #6
    Registered User
    Join Date
    08-19-2015
    Location
    London, England
    MS-Off Ver
    365
    Posts
    67

    Re: VBA/Macro Save rows (based on criteria) as value to new sheet in closed workbook(s)...

    I Figured it out. Thanks again..

+ 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. Adding active rows from sheet to closed database-workbook
    By psjpsjpsjpsj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2017, 02:54 PM
  2. [SOLVED] macro to copy from a closed workbook on a desktop folder and save specific amended sheet
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2017, 08:56 AM
  3. Export data with two Criteria values from closed workbook to closed workbooks VBA
    By julielara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2016, 01:56 PM
  4. Replies: 3
    Last Post: 03-11-2014, 02:10 PM
  5. Replies: 4
    Last Post: 01-20-2011, 03:39 AM
  6. Macro for deleting rows based on criteria from another sheet
    By arnab0711 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2011, 03:21 AM
  7. Replies: 1
    Last Post: 01-19-2011, 05:08 AM

Tags for this Thread

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