Hello!
I have a new project where I need to export data again. My data spans columns A - J, where if J = 101 (which is a calculated field and formatted as general), then copy all 101 rows to the desired sheet. Can you tell me how to do that? My current syntax is below and I get Object Required when trying to run it. Thank you for your help!
Sub GBEquipAllocation()
Dim cell As Range
Dim lastRow As Long, i As Long
lastRow = Range("J" & Rows.Count).End(xlUp).Row
i = 2 ' change this to the wanted starting row in sheet2
For Each cell In Sheets("Allocation").Range("J2:J" & lastRow)
If cell.Value.Range("J:J") = 101 Then
cell.EntireRow.Copy
GBEquipAlloc.Cells(i, 1).PasteSpecial xlPasteValues
i = i + 1
End If
Next
End Sub
I have a new project where I need to export data again. My data spans columns A - J, where if J = 101 (which is a calculated field and formatted as general), then copy all 101 rows to the desired sheet. Can you tell me how to do that? My current syntax is below and I get Object Required when trying to run it. Thank you for your help!
Sub GBEquipAllocation()
Dim cell As Range
Dim lastRow As Long, i As Long
lastRow = Range("J" & Rows.Count).End(xlUp).Row
i = 2 ' change this to the wanted starting row in sheet2
For Each cell In Sheets("Allocation").Range("J2:J" & lastRow)
If cell.Value.Range("J:J") = 101 Then
cell.EntireRow.Copy
GBEquipAlloc.Cells(i, 1).PasteSpecial xlPasteValues
i = i + 1
End If
Next
End Sub