Hi All,
I'm new to VBA, and have been searching for threads with similar issue but can't seem to find exactly what i'm trying to do.
I have price data in column A, and a text column in column F. I am searching for 2 specific text "BUYOPEN" and "SELLCLOSE" in column F. Once those are found, i am attempting to find its corresponding price from the same row in column A.
The macro i have so far, is finding the text "BUYOPEN" and placing the corresponding price in the next column. but i would like to add/update the code to summarize this data in a 2nd worksheet.
So everytime there is a "BUYOPEN" or "SELLCLOSE", it will list each occurence along with the corresponding price in a new worksheet.
appreciate any help. thanks
sample data
<TBODY>
</TBODY>
</PRE>
I'm new to VBA, and have been searching for threads with similar issue but can't seem to find exactly what i'm trying to do.
I have price data in column A, and a text column in column F. I am searching for 2 specific text "BUYOPEN" and "SELLCLOSE" in column F. Once those are found, i am attempting to find its corresponding price from the same row in column A.
The macro i have so far, is finding the text "BUYOPEN" and placing the corresponding price in the next column. but i would like to add/update the code to summarize this data in a 2nd worksheet.
So everytime there is a "BUYOPEN" or "SELLCLOSE", it will list each occurence along with the corresponding price in a new worksheet.
appreciate any help. thanks
Code:
Sub FindWord()
Dim FindString As String
Dim FindCell As Range
FindString = ("BUYOPEN")
If FindString = "" Then Exit Sub
For Each FindCell In Range(ActiveSheet.Range("F1"), ActiveSheet.Range("F300").End(xlUp)).Cells
If InStr(FindCell, FindString) > 0 Then FindCell.Offset(, 1) = FindCell.Offset(, -5)
Next FindCell
End Sub
sample data
51.6323 | 0 | 0 | 0 | SELL | 0 | |
52.08857 | 0 | 0 | 0 | SELL | 0 | |
52.1537 | 0 | 0 | 0 | BUY | BUYOPEN | 52.1537 |
52.29881 | 0 | 0 | 0 | BUY | 0 | |
52.42449 | 0 | 0 | 0 | BUY | 0 | |
52.60843 | 0 | 0 | 0 | BUY | 0 |
<TBODY>
</TBODY>
</PRE>