Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sumif across multiple sheets in excel 2007 based on a condition dave@homedeliverygroup Excel Worksheet Functions 6 May 13th 10 07:42 PM
Sum across sheets based on a condition GoBow777 Excel Worksheet Functions 3 March 8th 08 08:21 PM
Referencing Across Sheets Based On Condition Ramesh.S, India Excel Worksheet Functions 1 October 12th 06 02:48 PM
Reading Web site based combo box type values snowman[_2_] Excel Programming 0 April 28th 05 05:12 PM
Cannot sum values based on condition Ned Flanders Excel Worksheet Functions 1 December 3rd 04 04:36 AM


All times are GMT +1. The time now is 12:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"