Reading Values Between Sheets Based On The Condition

B

born2achieve

i have 2 sheets in my excel workbook. in my second workbook i have the values
as follows

A B

ss 10
yy 20
zz 30

so in my first sheet values:

X Y

(List)
ss
yy
zz

in my first sheet X range i have list which consists ss,yy,zz
so i f choose ss from the list it has to check the valu for ss in sheet2 and
has to fetch 10 and display in Y range

my excepcted output:
X Y

(List)
ss 10

please give me some sample code for this please
 
J

Joel

Sub test()


validationRange = ActiveSheet.Range("X1").Validation.Formula1
'remove equal sign
validationRange = Mid(validationRange, 2)
validationdata = ActiveSheet.Range("X1")
Set selectedcell = Range(validationRange).Find(what:=validationdata, _
LookIn:=xlValues, lookat:=xlWhole)

With Sheets("Sheet2")
Set c = .Columns("A:A").Find(what:=validationdata, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
YValue = c.Offset(0, 1)

selectedcell.Offset(0, 1) = YValue

End If

End With
End Sub
 
B

born2achieve

Dear friend, i dont have idea how to implement this.can u please give some
sample xls file which demonstrate the implementation of your code please
 
B

born2achieve

dear friend,
can u please give some excel file which implements your code .so that it
will be very most helpful for me please
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top