Announcement

Collapse
No announcement yet.

Access : VBA copy data to another workbook

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Access : VBA copy data to another workbook

    hi i have a workbook 1 that hav data from a:h
    and i want to added this data to workbool 2 in sheet 1, the data can be copy in the same order, and every tiime i run the macro the data ransfered is added to the old data already transfered.thanks

  • #2
    luisve,

    Try this code and adapt to suit your needs:

    Sub Macro1()

    Sheets("Sheet1").Range("a1", Range("h65536").End(xlUp)).Select
    Selection.Copy
    Workbooks("Book2").Activate
    Sheets("sheet1").Range("a65536").End(xlUp).Offset(1, 0).Select
    ActiveSheet.Paste

    End Sub

    NB code assumes both workbooks are open and that the code is being run while book1 is the active book.

    Regards
    Weasel
    Kind Regards
    Pesky Weasel
    "I have a plan so cunning, you could put a tail on it and call it a Weasel." EB
    Eagles may soar, but Weasels don't get sucked into jet engines.
    Templates and Calculators
    The Way of the Weasel
    Download Ivan & Colo's HTML Maker Here
    101 Excel Hacks - Great New Book
    Huge Savings on Excel Training

    Comment

    Working...
    X