Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Aug 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy&Paste to new workbook (English/Excel 2000)

    I have a macro installed on about 20 office P.C.s that copies information from a working file on their local drive to a "gathering" file on a network drive (using Access for this project is not an option). The macro works well with one odd quirk. Each week the information from one user does not get transferred. It is a different user each week and none of them received any message boxes or other warnings when performing the transfer. I did test the macro when the network file was open and I received the message box stating that the file was unavailable for editing. I've included the portion of the macro that performs the paste operations and am looking for any ideas on why this is happening. THANKS 'opens Worked Permits worksheet
    ChDir "P:"
    Workbooks.Open Filename:="PataWorkedFile.xls"
    'selects cell Al
    Range("A1").Select
    'moves to next available row
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Range("A1").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy&Paste to new workbook (English/Excel 2000)

    Depending on what the data in the sheets looks like, there are a couple of things in that code that could be causing some problems. Try using something like the following:

    <pre>Dim oTWB As Workbook, oCell As Range
    Set oTWB = Workbooks.Open(Filename:="C:WorkWorkedFile.xls")
    Set oCell = oTWB.Worksheets("Sheet1").Range("A65536").End(xlUp ).Offset(1, 0)
    oCell.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    </pre>

    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •