• 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.

Help with vba code to move data from a worksheet to another.

Hey! Looks like the attachment didn’t come through, so it’s a little tough to know exactly what your setup looks like. But if you're just trying to move dollar amounts from one sheet to another using VBA, here's a basic starting point that might help:
Code:
Sub MoveDollarAmounts()
    Dim wsSource As Worksheet
    Dim wsTarget As Worksheet
    Dim lastRow As Long
    Dim i As Long


    Set wsSource = ThisWorkbook.Sheets("Data") ' name of your source sheet
    Set wsTarget = ThisWorkbook.Sheets("Destination") ' name of your target sheet


    lastRow = wsSource.Cells(wsSource.Rows.Count, "B").End(xlUp).Row ' assuming data is in column B


    For i = 2 To lastRow ' skip header
        If IsNumeric(wsSource.Cells(i, "B").Value) Then
            wsTarget.Cells(i, "B").Value = wsSource.Cells(i, "B").Value
        End If
    Next i
End Sub


This assumes the amounts are in column B, same row positions on both sheets. You’ll want to adjust if you’ve got specific criteria or a different layout.

If you get a chance to re-upload the file or give more detail, I can help you fine-tune it
 
The easy way to move data between worksheets at once - so without any loop - is to use a filter, copy the filtered rows then delete them …​
 
Back
Top