+ Reply to Thread
Results 1 to 11 of 11

Copy a range of data and stop at 1st blank - to new template file VBA script XLS attached

  1. #1
    Registered User
    Join Date
    10-12-2006
    Posts
    46

    Copy a range of data and stop at 1st blank - to new template file VBA script XLS attached

    I believe that I found this sample here.

    Right now it creates new template file and opens a file and gets data.

    I would like to modify that it still creates new template file, but instead of opening another file to get data. It uses the current file where the vba code is and gets data starting at A2 and stops when if finds 1st empty row.
    Attached Files Attached Files
    Last edited by dj_mix; 03-24-2023 at 01:58 PM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta


    Hi,

    so always from the active worksheet or always from Sheet1 ?
    And you can trash the actual code …

  3. #3
    Registered User
    Join Date
    10-12-2006
    Posts
    46

    Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta

    Quote Originally Posted by Marc L View Post

    Hi,

    so always from the active worksheet or always from Sheet1 ?
    And you can trash the actual code …
    Hi Marc,

    Always from active worksheet would work great

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta


    So from the active worksheet that means the workbook can contain several worksheets, right ?
    But in this case how the user should launch the VBA procedure ?

  5. #5
    Registered User
    Join Date
    10-12-2006
    Posts
    46

    Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta

    Quote Originally Posted by Marc L View Post

    So from the active worksheet that means the workbook can contain several worksheets, right ?
    But in this case how the user should launch the VBA procedure ?
    Yes workbook contains several worksheets, I will launch similar to provided attachment. It will be launch by clicking on button.

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta


    So does that mean each worksheet has its own button ?

  7. #7
    Registered User
    Join Date
    10-12-2006
    Posts
    46

    Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta

    Quote Originally Posted by Marc L View Post

    So does that mean each worksheet has its own button ?
    Button only on sheet where data is

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta


    So the 'template' is only the worksheet where this button stands ?

  9. #9
    Registered User
    Join Date
    10-12-2006
    Posts
    46

    Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta

    Quote Originally Posted by Marc L View Post

    So the 'template' is only the worksheet where this button stands ?
    Yes, just that worksheet will have the button as in the attachment in 1st post

  10. #10
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta

    Here is an option for you. Since there is no filtering by row, we can do a straight copy and paste to a new workbook. If there is some data selection process, I can update the code. Let me know.

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-12-2006
    Posts
    46

    Re: Copy a range of data and stop at 1st blank - to new template file VBA script XLS atta

    maniacb,

    Works like a charm. I appreciate your help.

+ 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] How to set the column width = 20 following the attached script?
    By yannipr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2022, 08:52 AM
  2. Need A Fast Script To Copy 80000 Cells But My Current Script Is Too Slow
    By Genus Max in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-20-2019, 09:54 AM
  3. [SOLVED] date format attached d/mm/yyyy attached with hh:mm:ss
    By farrukh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-14-2017, 09:51 AM
  4. [SOLVED] Using .replyrecipients in vba script (See attached)
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-08-2015, 08:53 PM
  5. Replies: 0
    Last Post: 05-16-2012, 04:16 PM
  6. export sheet to .csv - need help modifying script
    By harbormaster in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2011, 06:52 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