View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Variable Data within a Macro

Maybe a simple INDEX/MATCH would suffice ?

In Sheet1,

Put in N21:
=IF(ISNA(MATCH("Doe, Jane",Sheet2!A:A,0)),"",INDEX(Sheet2!C:C,MATCH("Do e,
Jane",Sheet2!A:A,0)))
Format N21 as time to taste
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"jeannie v" wrote:
Hi: I am trying to auto-filter data that will change. Below is what I have
that works for the current day. The problem is that Worksheet 2 Column A
will not be in the same order each day. Therefore, the data in Column C for
the name in Column A will change and will be incorrect on Worksheet 1 the
next time I log the new data on Worksheet 2.

It seems that it would be so simple, but I can't figure it out....I'm really
a novice in Macros, and I would appreciate any help you can give me.

I want it to say: If "Doe, Jane" is found by auto-filter in Column A from
Cell A2:A60 in Worksheet 2 , Take her Time in Column C and copy to Worksheet
1 in Cells N21:O21.

This is what I have so far that works for the current day's data...when I
change the data on Worksheet 2, it doesn't pop the correct data on Worksheet
1 because the Rage changes in Column C on Worksheet 2.

Selection.AutoFilter Field:=1, Criteria1:="Doe, Jane"
Range("C27").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Jane D").Select
ActiveSheet.Paste


--
jeannie v