Consulting

Results 1 to 2 of 2

Thread: vba copy paste

  1. #1

    vba copy paste

    there are 2 files opened
    in 1st file i will place vba code
    and there is one more file which is opened
    copy the data of that file and paste the data in a vba placed file
    and close that file
    keep vba placed file open with that data

  2. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi tinamishra!
    Something like this:
    Sub CopyThat2This()
    Dim wb1 As Workbook, wb2 As Workbook
    Set wb1 = ThisWorkbook
    Set wb2 = Workbooks("That")  'enter what you want
    wb2.Sheets(1).[a1:x100].Copy wb1.Sheets(1).[a1]
    wb2.Close False
    Set wb1 = Nothing
    Set wb2 = Nothing
    End Sub
    --Okami

Tags for this Thread

Posting Permissions

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