ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reading Values Between Sheets Based On The Condition (https://www.excelbanter.com/excel-programming/404705-reading-values-between-sheets-based-condition.html)

born2achieve

Reading Values Between Sheets Based On The Condition
 
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

joel

Reading Values Between Sheets Based On The Condition
 
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


"born2achieve" wrote:

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


born2achieve

Reading Values Between Sheets Based On The Condition
 

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

born2achieve

Reading Values Between Sheets Based On The Condition
 
dear friend,
can u please give some excel file which implements your code .so that it
will be very most helpful for me please


All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com