+ Reply to Thread
Results 1 to 2 of 2

Macro Help With Copying Multiple Columns to New Workbook

Hybrid View

bigkahuna2187 Macro Help With Copying... 07-09-2012, 10:43 AM
bigkahuna2187 Re: Macro Help With Copying... 07-09-2012, 11:53 AM
  1. #1
    Registered User
    Join Date
    07-21-2011
    Location
    melbourne, florida
    MS-Off Ver
    Excel 2010
    Posts
    39

    Macro Help With Copying Multiple Columns to New Workbook

    I have done this before in 2007 but having problems getting it to work in 2010. I am doing some work that involves copyinging multiple columns. For example i would like to take copy A1:1000 from one workbook to, say, D1:D1000 in a new workbook.

    Here is an example of the macro I used when I still had 2007:

    Sub COPYCELL()
        Dim wbk As Workbook
        strFirstFile = "C:\Users\NAME\Desktop\Test\Test1.xlsm"
        strSecondFile = "C:\Users\NAME\Desktop\Test\Test2.xlsm"
        Set wbk = Workbooks.Open(strFirstFile)
        With wbk.Sheets("Sheet1")
            .Range("A1:A1000").Copy
        End With
        Set wbk = Workbooks.Open(strSecondFile)
        With wbk.Sheets("Sheet2")
            .Range("D1:D1000").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
                False, Transpose:=False
        End With
        End Sub
    For some reason it wont open the new workbook like it did before to paste the information from the original workbook.

    Any help would be appreciated. Thanks!
    Last edited by jeffreybrown; 07-09-2012 at 10:44 AM. Reason: Please use code tags not quote.

  2. #2
    Registered User
    Join Date
    07-21-2011
    Location
    melbourne, florida
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Macro Help With Copying Multiple Columns to New Workbook

    bump. anyone?

+ 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