Results 1 to 10 of 29

Thread: copy and paste by VBA based on criteria

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Your macro is good
    Your macro is working
    There are no errors in it.
    I did test on files enclosed , with this following macro. ( Macro is in sample1.xlsm )
    Code:
    Sub STEP4()
     Dim w1 As Workbook, w2 As Workbook
    Set w1 = Workbooks.Open(ThisWorkbook.Path & "\1.xls") ' Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\1.xls") ' change the file path
    Set w2 = Workbooks.Open(ThisWorkbook.Path & "\FundsCheck.xlsb") '  Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\FundsCheck.xlsb") ' change the file path
    w1.Worksheets.Item(1).Columns("A:H").Copy
    w2.Worksheets.Item(1).Columns("A:H").PasteSpecial Paste:=xlPasteValuesAndNumberFormats
    w2.Save
    w2.Close
    w1.Close
    End Sub
    
    Alan



    1.xls : https://app.box.com/s/th2xzmkh7rnfr4qf4dho1kpgudndm073
    Attached Files Attached Files
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Replies: 48
    Last Post: 09-23-2020, 02:03 AM
  2. Replies: 85
    Last Post: 06-09-2020, 05:58 PM
  3. Copy paste data based on criteria
    By analyst in forum Excel Help
    Replies: 7
    Last Post: 01-13-2014, 12:46 PM
  4. Replies: 8
    Last Post: 10-31-2013, 12:38 AM
  5. Replies: 2
    Last Post: 09-18-2013, 12:30 AM

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
  •