# Urgent I need a Formula, is a Challenge

Closed
A.j. - Jun 12, 2012 at 09:17 AM
Josh - Jun 13, 2012 at 10:12 AM
Hello,

I was wondering if anyone can help me, I have a Column with Text, and i need to find the word Cash on that column, and if there is such a word i want it to return me the value that has the cell from the left, lets say that my column goes from A1:A5 and only A1 says Cash, and in B1:B5 there are numbers, so I need a formula that idetifies the word cash and give me the value of the cell B1 which is a number.

Thanks a Million

Related:

## 2 responses

I assume "Cash" will repeated and spelled correctly. I don't know where you want to output the value, so I just wrote it into column D in the same row it is found.

Sub FindCash()
Dim LastRow, x As Long
LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For x = 1 To LastRow
If Range("A" & x) = "Cash" Then
Range("D" & x).Value = Range("B" & x)
End If
Next x
End Sub

Good luck.
Josh
I assume Cash will be repeated and will be spelled correctly. I didn't know where you wanted the output so I put it in column D in the same row.

Sub FindCash()
Dim LastRow, x As Long
LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For x = 1 To LastRow
If Range("A" & x) = "Cash" Then
Range("D" & x).Value = Range("B" & x)
End If
Next x
End Sub

Good luck,
Josh