• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy Multiple Cells form one Sheet to Another

PeterDavids

New Member
Dear All

I am in need of assistance of a two macro that copies the contents of a cell in the first sheet and then looks for the date intersection in the target sheet and pastes the value in the target sheet

The second button must do the same actions as above but the refence sheet is now a different sheet and the target sheet is the same one as above.


The attached file simulation contains further detailed explanations.

Many Thanks
Peter
 

Attachments

  • DateCopyFile.xlsm
    75.2 KB · Views: 5
Try assigning these to your buttons...
Code:
Sub Button1()
    Dim c As Range

    With Worksheets("Cash Flow Balances")
        Set c = .UsedRange.Find(Worksheets("Account_Add").Cells(7, 6).Value, LookIn:=xlValues)
        If Not c Is Nothing Then
            c.Offset(, 1) = Worksheets("Account_Add").Cells(10, 21).Value
            c.Offset(, 2) = Worksheets("Account_Add").Cells(15, 24).Value
            c.Offset(, 3) = Worksheets("Account_Add").Cells(15, 25).Value
            c.Offset(, 4) = Worksheets("Account_Add").Cells(15, 26).Value
        End If
    End With
End Sub

Sub Button2()
    Dim c As Range

    With Worksheets("Cash Flow Balances")
        Set c = .Columns(1).Find(Worksheets("Account_Less").Cells(7, 6).Value)
        If Not c Is Nothing Then
            c.Offset(, 5) = Worksheets("Account_Less").Cells(15, 24).Value
            c.Offset(, 6) = Worksheets("Account_Less").Cells(15, 25).Value
            c.Offset(, 7) = Worksheets("Account_Less").Cells(15, 26).Value
            c.Offset(, 8) = Worksheets("Account_Less").Cells(15, 27).Value
            c.Offset(, 9) = Worksheets("Account_Less").Cells(15, 28).Value
            c.Offset(, 10) = Worksheets("Account_Less").Cells(15, 29).Value
        End If
    End With
End Sub
 
Back
Top