Consulting

Results 1 to 3 of 3

Thread: VBA assistance required for copy values

  1. #1
    VBAX Newbie
    Joined
    Jul 2014
    Posts
    2
    Location

    VBA assistance required for copy values

    Hi - Id be very grateful for any assistance with this issue - FYI, I have zero knowledge of VBA so I'm hoping for a bells and whistles piece of code that I can just cut and paste into the VBA code place!!

    I have 2 sheets.

    First Sheet is called "A".
    Second Sheet is called "ResA"

    I want to copy values from "A" and paste to "ResA".

    Specifically, when cell AB4 in Sheet A = "END", then I want to copy and paste the values in sheet A - A5:AG30 to the cell (indirect) referenced on sheet A - AD3 (eg ResA!A8) in sheet ResA. Cell AB4 (macro trigger) is formula driven and may say "END" periodically, and each time I want to trigger the macro.

    Hope that's reasonably clear. It appears to be quite complex to me, so Id really appreciate a dig out.

    Thanks very much

    N32

  2. #2
    may say "END" periodically,
    in that case you would need to check its value in the worksheet selection change event, then run the code when criteria matches like
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Range("ab4").Value = "End" Then ' copy cells
    End Sub
    if you need the cells to copy, even if there is no user interaction, then you may need to use application.ontime

    in either case you may need to know if the cells were already copied during this period of ab4 value being "end", so it will only copy once during the cycle

  3. #3
    VBAX Newbie
    Joined
    Jul 2014
    Posts
    2
    Location
    Westconn1 - thank you for thr reply. The copy will not get into a loop as I have built this possibilty into the "END" formula - ie if the data in A5:AG30 has already been copied, AB4 will not = "END". Does that address your query? N32

Posting Permissions

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