PDA

View Full Version : Pulling data according to a cell value



progfrog
07-15-2010, 05:14 AM
hi guys
I'm new un exvel vba and i real can use some help ..

I have a value that is saved in variable

dim value1 as string
dim value2 as string
value1= orlando


Now i would like to find the position that keeps this value and also to pull a different value from a cell in the same row but in column C (for instance)

and save the value from column c in value2

How shell i write it in vba?

thanx thanx!

Bob Phillips
07-15-2010, 07:22 AM
Dim value1 As String
Dim value2 As String
Dim cell As Range

value1 = "orlando"

With ActiveSheet

Set cell = .UsedRange.Find(value1)
If Not cell Is Nothing Then

value2 = .Cells(cell.Row, "C").Value
End If
End With