Hi, I'm trying to parse through some financial data in Sheet1, and populate other sheets based on criteria. I did find some vba code that does what I want (almost). This code copies the entire row to the destination sheet, which works, but I'd like to put some calculations off to the right side of the data (for totals, etc). With this code, if the entire row is copied to the destination sheet, it overwrites my formulas. Can someone tell me how to reference a partial row for both the source and destination sheets so that it only copies the data I need? Instead of c.EntireRow, I'm hoping there's a better reference.
Of course, if there's a better way entirely, please share! Any help is greatly appreciated.
Kevin
Sub OJC_Copy()
Dim MyRange As Range, CopyRange As Range
Set Src = Sheets("Sheet1") 'Source data
Set dst = Sheets("OJC") 'Destination sheet
dst.UsedRange.ClearContents
LastRow = Src.Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set MyRange = Src.Range("H2:H" & LastRow)
For Each c In MyRange
If (c.Value) Like "SJ*" Then
If CopyRange Is Nothing Then
Set CopyRange = c.EntireRow
Else
Set CopyRange = Union(CopyRange, c.EntireRow)
End If
End If
Next
If Not CopyRange Is Nothing Then
CopyRange.Copy Destination:=dst.Range("a1")
End If
End Sub