Hi ,
i want to look up for a value which can be in a column range and store it in a variable for further use . How can i do it?
thanks, Carlo
Hi ,
i want to look up for a value which can be in a column range and store it in a variable for further use . How can i do it?
thanks, Carlo
More detail is needed.
What value is being sought?
What do you want to do if it isn't in the column?
"store it for further use":
1) store it where? what future use?
2) if we know the value at the beginning, why look in the column, why not just store it without looking?
If you just want to check if that value is there, try something like
[vba]
Dim cell As Range
Set cell = Columns(1).Find("XYZ")
If cell Is Nothing Then
MsgBox "Not found"
Else
MsgBox "Found in row " & cell.Row
End If
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
first of all, thank you both
then some clarifications for mikerikson :
i want to store the result of the search in a variable as i need to verify whether that value has already been assigned in the cell 'x' of a specific row; this string value is already present in a cell of the row but has to be stored , given certain conditions , in the cell x to produce an encoding that will be used furthermore in another program .
Since i'm trying to apply also other controls , by now i'm working on the first part of the development (very useful your post xld), than i'll be very glad if you could help me later on .
Bye guys!