Results 1 to 2 of 2

File open and copy data

Threaded View

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    57

    Smile File open and copy data

    Sub a()
    Dim X As Integer
    Set shmap = ThisWorkbook.Sheets("MAP")
    NumRows = 18 '
    For X = 3 To NumRows
    lastrow = shmap.Cells(Rows.Count, "A").End(xlUp).Row + 2
    File = Cells(X, 2).Value
    Code = Cells(X, 1).Text
    Set wb = Workbooks.Open(File)
    code to copy Range A100: Az200
    Range("A1:AZ100").Copy shmap.Cells(lastrow, 1)
    wb.Close
    Cells(X, 1).Copy Sheets(Code).Range("A100")
    the copied data to go into the relevant sheet(not the cell name)
    Next
    End Sub
    Last edited by grimston; 10-09-2012 at 01:24 AM. Reason: chang title

Thread Information

Users Browsing this Thread

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

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