Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X

Hello,

I have a workbook which contains sheets for a 4-week rota period. A
one rota period ends, people either owe (or are owed) hours.

*I would like ...* to write a user defined function that will look at
name in Sheet X!Column A, find that name on the Sheet immediately t
the left of this sheet and return the content of a cell further alon
on the same row.

I have been trying to do this with the Index and Match function i.e.

=INDEX('March 22'!$E$12:$E$142,MATCH(C45,'March 22'!$C$12:$C$142,0))

but don't want users to have to retype the sheet name for each ne
4-week period.

What do you think? Clear as mud ... or can you help?

Thanks,

Temp

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X

Tempy,

You could try using a macro. If your ranges are always the same, you could
use something like this to reproduce your formula:

ActiveCell.FormulaR1C1 = _
"=INDEX('" & Worksheets(ActiveSheet.Index - 1).Name & _
"'!R12C5:R142C5,MATCH(R[" & ActiveCell.Row & "]C3,'" & _
Worksheets(ActiveSheet.Index - 1).Name & "'!R12C3:R142C3,0))"

However, your formula didn't reference column A of anywhere, so I'm not sure
what you meant specifically.

HTH,
Bernie
MS Excel MVP

"tempjones " wrote in message
...
Hello,

I have a workbook which contains sheets for a 4-week rota period. As
one rota period ends, people either owe (or are owed) hours.

*I would like ...* to write a user defined function that will look at a
name in Sheet X!Column A, find that name on the Sheet immediately to
the left of this sheet and return the content of a cell further along
on the same row.

I have been trying to do this with the Index and Match function i.e.

=INDEX('March 22'!$E$12:$E$142,MATCH(C45,'March 22'!$C$12:$C$142,0))

but don't want users to have to retype the sheet name for each new
4-week period.

What do you think? Clear as mud ... or can you help?

Thanks,

Tempy


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X

Hi Bernie,

That does make sense - the column A reference was a red herring.

I have yet to make it work but am going to play around before I pos
again.

Thanks,

Temp

--
Message posted from http://www.ExcelForum.com

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
copying whole row to another sheet based on criteria on cell tabylee via OfficeKB.com Excel Discussion (Misc queries) 0 January 23rd 10 03:04 PM
Move data to new sheet - rename sheet based on criteria ? [email protected] Excel Discussion (Misc queries) 7 May 16th 07 10:22 PM
Need to look up value in another Sheet based on criteria in first sheet. Stacey Excel Worksheet Functions 1 March 28th 06 06:22 AM
Refer to sheet name specified in other cell Marko Pinteric Excel Discussion (Misc queries) 2 March 4th 05 09:13 AM
Refer to a sheet in a cell Esben Excel Programming 3 May 26th 04 08:33 PM


All times are GMT +1. The time now is 03:29 PM.

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

About Us

"It's about Microsoft Excel"