+ Reply to Thread
Results 1 to 7 of 7

VBA Macro - Exporting Data to New Worksheets

  1. #1
    Registered User
    Join Date
    12-10-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    4

    VBA Macro - Exporting Data to New Worksheets

    I have a list that I would like to automatically go through and export a row of data that does not equal zero.

    For instance, Row 35 and Row 36 is zero, Row 37 begins to change value, Rows 38 -40 values keeps changing, Row 40 and 41 value equals to zero.

    Rows 36 to 40 would then be exported to a new worksheet.

    The macro would then continue to search through the remaining list to find similar instances and export, until end of list.

    Any help would be appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: VBA Macro - Exporting Data to New Worksheets

    Hi and welcome.

    Would they all copy to the same sheet or would each yellow section get copied to its own sheet?

    Beth.

  3. #3
    Registered User
    Join Date
    12-10-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA Macro - Exporting Data to New Worksheets

    Hey Beth,

    Each yellow section would gets its own sheet. Thank you.


    David

  4. #4
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: VBA Macro - Exporting Data to New Worksheets

    Maybe something like this?
    Please Login or Register  to view this content.
    Beth.

  5. #5
    Registered User
    Join Date
    12-10-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA Macro - Exporting Data to New Worksheets

    Good Morning Beth,
    Thank you for the code..

    I think I might have mislead you.

    Only looking at column "B":

    if I look at R81 and R82, this equals 0.

    If I look at R82 and R83, the value is no longer 0, which means an event is occurring.

    R83 and R84, event still occurring.

    R84 and R85, equals 0, meaning event has basically stopped.

    At this point, I want to export R82 to R84, where the event started and stopped.

    81- 11-Sep-19 10:18:00 0.034659
    82 - 11-Sep-19 10:19:00 0.034659
    83 - 11-Sep-19 10:20:00 0.046188
    84 - 11-Sep-19 10:21:00 0.059857
    85 - 11-Sep-19 10:22:00 0.059857

    I really appreciate your help.

    David

  6. #6
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: VBA Macro - Exporting Data to New Worksheets

    Could you manually put together your expected outcome and attach that?

    I'm confused because as far as I can tell my code is doing what you asked for except copying all columns and basing the 'event start/end' on column D.

    Beth.
    Last edited by BanginMyHeadOnMyDesk; 09-15-2019 at 08:56 AM.

  7. #7
    Registered User
    Join Date
    12-10-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA Macro - Exporting Data to New Worksheets

    I've attached the spreadsheet that I hope can help explain.

    The green cells are the cells that will be used to determine if an event took place or not, column "B". In column "F" and highlighted in blue are formulas that I included for your use to see if an event occurred or not. you can use the same formula in your code for column "B".

    From the time that an event took place to where there is no event, these rows and headers will be moved to another worksheet. The tab for that worksheet has the start time and date of that particular event start time and date. I've made three worksheets as examples.

    You should start from the top and work your way to the bottom of the list.

    Let me know if this helps any... thank you a whole bunch!!
    Attached Files Attached Files

+ 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] Exporting Data in 2 Cells from multiple worksheets into new worksheet
    By mickwooduclan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-12-2012, 06:34 AM
  2. Replies: 2
    Last Post: 10-25-2012, 11:34 AM
  3. Replies: 3
    Last Post: 08-17-2012, 02:41 PM
  4. Exporting data from different worksheets to create a new oulook calendar appointment
    By battenborrow in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2011, 08:53 AM
  5. Exporting Data from SQL Server to Excel using Macro
    By skylab in forum Excel General
    Replies: 4
    Last Post: 02-10-2011, 05:51 AM
  6. Exporting data from ms-access database to multiple worksheets using ASP
    By sridevi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-11-2005, 07:06 AM
  7. [SOLVED] Need Excel macro for exporting data to Access
    By halfshoe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-18-2005, 06:06 PM

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