matthew230
Board Regular
- Joined
- Jan 2, 2006
- Messages
- 152
Hi Guys,
I am completely self taught, and need a few pointers on learning a new technique.
I need to be able to look at an entire column and search for a value. Once the value is found, then I need to make that cell a variable.
I have got so far
Dim currentcell As Range
Sub test()
For Each cell In Range("a1:a10")
If cell.Value = "b" Then
MsgBox "found it"
cell.Select
currentcell = Range(cell)
End If
Next
MsgBox currentcell
End Sub
The currentcell = range(cell) is the line that doesn't work.
Can someone help with this ??
Many thanks,
Matt
I am completely self taught, and need a few pointers on learning a new technique.
I need to be able to look at an entire column and search for a value. Once the value is found, then I need to make that cell a variable.
I have got so far
Dim currentcell As Range
Sub test()
For Each cell In Range("a1:a10")
If cell.Value = "b" Then
MsgBox "found it"
cell.Select
currentcell = Range(cell)
End If
Next
MsgBox currentcell
End Sub
The currentcell = range(cell) is the line that doesn't work.
Can someone help with this ??
Many thanks,
Matt