Results 1 to 6 of 6

Copying RANGE to next blank row of a different sheet each time data generated

Threaded View

  1. #1
    Registered User
    Join Date
    01-24-2022
    Location
    Manchester
    MS-Off Ver
    Office 2013, Office 365
    Posts
    8

    Question Copying RANGE to next blank row of a different sheet each time data generated

    Hello Everyone, quite new to VBA and it has taken me quite a while to get to this point.

    First worksheet shows button 'Get Outlook Data' when clicked you choose an Outlook folder then the data is posted to the 'Outlook Results' sheet.

    Each time the macro runs it clears the data from 'Outlook Results' this is required. The data is currently in columns A - K (this will no doubt be extended).

    However, each time the [GetMailInfo] is run (on a button) I need to be able to paste the data to the next blank row on the 'Results History' sheet each time the macro runs.

    I've attached a sample workbook.

    I used the code found on this forum (noted below) but no matter where I placed it, it wasn't copying to the 'Results History' sheet. Would be great to run this automatically after [GetMailInfo].

    My question, where and how do I get the macro below to automatically run after the 'GetMailInfo' macro is run. Help really appreciated thank you.

    Sub CopyData()
    
        Dim NextRow As Long
    
        With Sheets("Outlook Results")
            Sheets("Outlook Results").Range("A2").CurrentRegion.Copy
    
        End With
        
        NextRow = Sheets("Results History").Range("A2" & Rows.Count).End(xlUp).Row + 1
    
        Sheets("Results History").Range("A2" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
    
    End Sub
    Please any help guidance whatsoever for this is greatly appreciated!!

    Regards,
    Cozza22
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copying data from one sheet to other in the same workbook is taking too long time
    By Saritha123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2021, 08:19 AM
  2. [SOLVED] Copying non-blank cell data into another sheet
    By 99problems in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-30-2015, 09:14 PM
  3. [SOLVED] Problem with copying data from system generated spreadsheet
    By Stephen R in forum Excel General
    Replies: 1
    Last Post: 12-16-2014, 06:15 PM
  4. Adding time and copying rows of data to a separate sheet
    By Bootface in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-01-2014, 08:07 AM
  5. Run-time error '5' when copying range of cells to different sheet
    By Meriwether in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2014, 02:55 PM
  6. copying data to a blank sheet
    By steveg666 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2013, 09:36 AM
  7. Data Copying for an input date range to another sheet
    By meetbhupen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-25-2010, 11:45 PM

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