+ Reply to Thread
Results 1 to 3 of 3

Paste exported data, help with adjustment of vba

Hybrid View

2001jesper Paste exported data, help... 07-16-2013, 03:23 PM
AB33 Re: Paste exported data, help... 07-16-2013, 03:48 PM
2001jesper Re: Paste exported data, help... 07-16-2013, 04:29 PM
  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    61

    Question Paste exported data, help with adjustment of vba

    I guys

    iam making a vba that exports a range from 1 sheet, to a specific place in another. However, cant seem to make it paste the data

    Private Sub CommandButton1_Click()
    Dim ActivityMap As Range
    'More?
    Dim Export As Workbook
    
    Sheets("Export sheet").Select
    Set ActivityMap = Range("B7:AT7")
    'the range i want to be exported
    
    Set Export = Workbooks.Open("C:\xxxxxxxxxxx.xlsm")
    Worksheets("Import sheet").Select
    Worksheets("Import sheet").Range("b10:AT10").Select
    RowCount = Worksheets("Import sheet").Range("B10:AT10").CurrentRegion.Rows.Count
    With Worksheets("Import sheet").Range("B10:AT10")
    .Offset(RowCount, 0) = ActivityMap
    End With
    Export.Save
    
    End Sub
    Hope anyone can find my mistake

    thx in advance
    Last edited by 2001jesper; 07-16-2013 at 04:28 PM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Paste exported data, help with adjustment of vba

    May be

    Sheets("Export sheet").Select
    'the range i want to be exported
    
    Set Export = Workbooks.Open("C:\xxxxxxxxxxx.xlsm")
    Set ActivityMap = Range("B7:AT7")
    RowCount = Worksheets("Import sheet").Range("B" & Rows.Count).End(xlUp).Row + 1
    ActivityMap.Copy
    Worksheets("Import sheet").Range("B" & RowCount).PasteSpecial xlValues
    Application.CutCopyMode = 0
    Export.Save

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Paste exported data, help with adjustment of vba

    Thank you, did a minor modification in terms of wenn to copy, and your VBA worked like a charm! Thumbs up

+ 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. Excel exported data is not exactly.
    By indosta in forum Excel General
    Replies: 0
    Last Post: 05-14-2013, 09:37 AM
  2. Replies: 7
    Last Post: 07-16-2012, 04:25 PM
  3. Replies: 0
    Last Post: 05-20-2009, 05:37 AM
  4. Truncated Exported Data
    By baconroll in forum Excel General
    Replies: 0
    Last Post: 04-05-2006, 07:25 AM
  5. Arabic Data is exported as ????
    By syedmoiz in forum Excel General
    Replies: 0
    Last Post: 01-11-2005, 02:01 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