Results 1 to 2 of 2

Copy data between workbooks

Threaded View

arn0ldas Copy data between workbooks 09-03-2013, 05:26 AM
arn0ldas Re: Copy data between... 09-04-2013, 06:36 AM
  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    Lithuania Kaunas
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    98

    Question Copy data between workbooks

    Hello everyone. I need your help. I tried to do it myself, but I could not

    I have a macro command that copies the information from worksheets in new sheet "Consolidated" but everything works in one workbook.
    i need two different workbooks
    1) Source data.xml
    2) Reports.xmlx

    macro i will run from Workbook - "reports.xmlx" and macro will copy information from workbook "source data.xml"
    Sub Copy_sheats_v2()
    
    Dim wsTest As Worksheet
    
    Const strSheetName As String = "Consolidated"
     
    Set wsTest = Nothing
    On Error Resume Next
    Set wsTest = ActiveWorkbook.Worksheets(strSheetName)
    On Error GoTo 0
     
    If wsTest Is Nothing Then
        Worksheets.Add.Name = strSheetName
    End If
    
    With Sheets("Consolidated")
        .UsedRange.ClearContents
        .Range("A1:AG1").Value = Array("SKYRIUS", "UÞSAKOVAS", "PREKIØ GAVËJAS", _
        "KB - UÞSAKYMAS", "PARDAVIMO UÞSAKYMAS", "GAMINIO KODAS SAP", "GAMINIO PAVADINIMAS", _
        "PASTABOS", "TVIRTINIMO SAV", "UÞSAKYTAS KIEKIS", "ATKROVIMAS", "APMUÐIMAS", _
        "KAINA, LT", "BENDRA SUMA, LT", "APKROVIMAS", "BENDRAS APKROVIMAS", "ÁSIPAREIGOJIMO DATA", _
        "ÁVEDIMO DATA", "TIEKIMO GALUTINË DATA", "NADIA IVINSKIENË", "VIKTORAS UOGINTAS", _
        "MINDAUGAS KERÐYS", "PARUOÐTA APMUÐIMUI", "SUKIRPIMAS", "SIUVYKLA", "LAKÐTINËS", _
        "KARKASAI", "POROLONAS", "TÛRIS, M3", "BENDRAS TÛRIS, M3", "ÐALIS", "GRUPË", "APMUÐIMO SAV")
        For Each Sh In Sheets
            With Sh
                If .Name = "SKUBUS" Or .Name = "BXS" Or .Name = "ACTONA" Or .Name = "LOVOS" _
                Or .Name = "MOEMAX" Or .Name = "KONVEJERIAI" Then
                    Rng = .Cells.Find("*", , , , xlByRows, xlPrevious).Row - 1
                    NR = Sheets("Consolidated").Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1
                    If Rng > 0 Then
                        Sheets("Consolidated").Cells(NR, 1).Resize(Rng) = .Name
                        Sheets("Consolidated").Cells(NR, 2).Resize(Rng, 32) = .Range("A4").Resize(Rng, 32).Value
                    End If
                End If
            End With
        Next
        .Columns("A:AG").EntireColumn.AutoFit
    End With
    End Sub
    this is macro vat i use for copy from different worksheets but its works only in sesame workbook

    I tried to use the information found on the internet but I could not adjust

    maybe you can help
    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. Replies: 32
    Last Post: 09-16-2013, 01:40 AM
  2. Copy Data from 100 workbooks with cells into a master workbooks
    By roy__lam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2013, 02:11 PM
  3. I need to copy data from various workbooks into one master file, specific data
    By madhumith13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-21-2013, 09:14 AM
  4. Copy data between workbooks
    By langano in forum Excel General
    Replies: 1
    Last Post: 04-20-2012, 09:51 PM
  5. To copy data from different workbooks
    By raja in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-20-2005, 10:05 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