+ Reply to Thread
Results 1 to 2 of 2

Export row data to new workbook

  1. #1
    Registered User
    Join Date
    10-21-2014
    Location
    San Diego
    MS-Off Ver
    2010
    Posts
    1

    Export row data to new workbook

    I am attempting to write a simple code to copy a selected row and export the data to a new workbook with the name from the first cell.

    A B C D
    1 Test1 1 2 3
    2 Test2 4 5 6

    So if I was to select Row 2 the macro would create a new workbook named "Test2" with the data from row 2

    A B C D
    2 Test2 4 5 6

    I cant figure out how to make the Rows("1:1").Select to be reflective of the actual selected row like the Activecell.select function.

    Thanks

    Sub Macro1()

    Rows("1:1").Select
    Selection.Copy
    Workbooks.Add
    Rows("1:1").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    ActiveWorkbook.SaveAs Filename:="C:\Users\Book2.xlsx", _
    FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    End Sub

  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: Export row data to new workbook

    Please use code tags when posting. See Forum Rule No. 3.

    http://www.excelforum.com/forum-rule...rum-rules.html

    Maybe:

    Please Login or Register  to view this content.

+ 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: 03-27-2014, 12:38 PM
  2. Export data from one workbook onto next
    By kamran_ijazz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2013, 08:45 AM
  3. Export data from closed workbook to active workbook with ADO connection
    By Naresh27 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-09-2013, 01:08 PM
  4. I would need a macro to export data from base example workbook to export worbook
    By slato8 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2012, 11:21 AM
  5. Filter and Export Data-Workbook to Workbook
    By sly in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-02-2007, 04:03 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