Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ziv ziv is offline
external usenet poster
 
Posts: 3
Default worksheet referencing

I am trying to create a function that uses the vlookup worksheet function to
look up a value from the previous sheet. eg. The sheet "Mar 2005" will lookup
the values in "Feb 2005" and then "Feb 2005 " will look at "Jan 2005", and so
on, the sheets are in order Jan 2005, Feb 2005,... . The function is only to
ask the user the value to look up and then it will look up the previous
corresponding table on previous sheet.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default worksheet referencing

does something like this help:

Sub TestMe()
Dim Ans As String
Dim Response As String

Ans = InputBox("Enter some Text", "My Title", "Hello")
'look for Ans in col 1 of MyTable and return the value in col 4 of same
range
Response = Application.VLookup(Ans, MyTable, 4, False)
MsgBox Response
' more code
End Sub

"Ziv" wrote:

I am trying to create a function that uses the vlookup worksheet function to
look up a value from the previous sheet. eg. The sheet "Mar 2005" will lookup
the values in "Feb 2005" and then "Feb 2005 " will look at "Jan 2005", and so
on, the sheets are in order Jan 2005, Feb 2005,... . The function is only to
ask the user the value to look up and then it will look up the previous
corresponding table on previous sheet.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default worksheet referencing

Assuming the value to lookup is in A1, the lookup range is A1:H100, and the
tab names have an embedded space then

=VLOOKUP(A1,INDIRECT("'"&TEXT(DATEVALUE("01
"&MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255))-1,"mmm
yyyy")&"'!A1:H100"),2,FALSE)

won't work on Jan of course

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ziv" wrote in message
...
I am trying to create a function that uses the vlookup worksheet function

to
look up a value from the previous sheet. eg. The sheet "Mar 2005" will

lookup
the values in "Feb 2005" and then "Feb 2005 " will look at "Jan 2005", and

so
on, the sheets are in order Jan 2005, Feb 2005,... . The function is only

to
ask the user the value to look up and then it will look up the previous
corresponding table on previous sheet.



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
Referencing another worksheet Carena Excel Worksheet Functions 2 August 27th 08 12:26 AM
referencing the name of a worksheet Simon P California Excel Discussion (Misc queries) 5 October 15th 07 02:47 PM
Referencing a Worksheet newguy Excel Discussion (Misc queries) 3 December 12th 06 07:31 PM
CountIF() in Worksheet B while referencing cells in Worksheet A jfj3rd Excel Worksheet Functions 3 April 14th 06 11:24 PM
CountIF() in Worksheet B while referencing cells in Worksheet A jfj3rd Excel Worksheet Functions 3 April 14th 06 07:36 PM


All times are GMT +1. The time now is 07:16 AM.

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"