Hello,
I have a VBA script that pulls data from a transaction/order history sheet and assigns them to an individual sheet for each subject.
My problem is, as the script is running through the transaction/order history sheet and hits on the right conditions it should copy to the new sheet, it doesn't copy them to where the new sheets last entry was, it copies them in the order that they were found.
Any help with this would be awesome and thank you in advance
I have a VBA script that pulls data from a transaction/order history sheet and assigns them to an individual sheet for each subject.
My problem is, as the script is running through the transaction/order history sheet and hits on the right conditions it should copy to the new sheet, it doesn't copy them to where the new sheets last entry was, it copies them in the order that they were found.
Code:
[SIZE=1]Sub BTC()[/SIZE]
[SIZE=1]Trow = 7[/SIZE]
[SIZE=1]Row = 8[/SIZE]
[SIZE=1]Ticker = "BTC"[/SIZE]
[SIZE=1]For Each Cell In Range("E8:E3000", "F8:F3000")[/SIZE]
[SIZE=1] If Cells(Trow, "E") = "BUY" And Cells(Trow, "F") = Ticker Then[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BF").Value = Cells(Trow, "B").Value 'date[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BG").Value = Cells(Trow, "K").Value 'Asset Sold[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BH").Value = Cells(Trow, "G").Value 'volume[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BI").Value = Cells(Trow, "H").Value 'price usd[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BJ").Value = Cells(Trow, "I").Value 'price btc[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BK").Value = Cells(Trow, "J").Value 'price usd|btc[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BL").Value = Cells(Trow, "X").Value 'Fee Value usd[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BM").Value = Cells(Trow, "AB").Value 'Fee Value btc[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BN").Value = Cells(Trow, "AF").Value 'Fee Value usd|btc[/SIZE]
[SIZE=1] ElseIf Cell(Trow, "E") = "SELL" And Cell(Trow, "K") = Ticker Then[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BF").Value = Cells(Trow, "B").Value 'date[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BG").Value = Cells(Trow, "F").Value 'Asset Sold[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BH").Value = Cells(Trow, "L").Value 'volume[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BI").Value = Cells(Trow, "H").Value 'price usd[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BJ").Value = Cells(Trow, "I").Value 'price btc[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BK").Value = Cells(Trow, "J").Value 'price usd|btc[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BL").Value = Cells(Trow, "X").Value 'Fee Value usd[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BM").Value = Cells(Trow, "AB").Value 'Fee Value btc[/SIZE]
[SIZE=1] Sheet5.Cells(Row, "BN").Value = Cells(Trow, "AF").Value 'Fee Value usd|btc[/SIZE]
[SIZE=1] End If[/SIZE]
[SIZE=1] Row = Row + 1[/SIZE]
[SIZE=1] Trow = Row + 1[/SIZE]
[SIZE=1] Next Cell[/SIZE]
Any help with this would be awesome and thank you in advance
Last edited by a moderator: