+ Reply to Thread
Results 1 to 2 of 2

File open and copy data

  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)
    Please Login or Register  to view this content.
    Range("A1:AZ100").Copy shmap.Cells(lastrow, 1)
    wb.Close
    Cells(X, 1).Copy Sheets(Code).Range("A100")
    Please Login or Register  to view this content.
    Next
    End Sub
    Last edited by grimston; 10-09-2012 at 01:24 AM. Reason: chang title

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Help with vba code

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.



    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Ben Van Johnson

+ Reply to Thread

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