Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Looking up dates


Hi,

i have a table as shown in the attached picture. Its a registeratio
database built in excel.

Is it possible to have a report on a seperate spreadsheet which whe
the user puts in a name it'll match to the name on this spreadsheet an
return the dates for when an employee is off sick or on holiday or lat
and so on.

So say i wanted to know mr x's sick days, it would have to find hi
sick boxes, (which are red with an S) under his name and return th
values in the first column which is the dates.

Is this possible?

So far i have this code which will look up the amount of times someon
is off sick or whichever:


Code
-------------------


Sub Macro_ChangeData()

Dim Stringd As String
Stringd = InputBox("Please enter an Employee's name as it appears exactly in the register")
Range("C9").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,1,FALSE)"
Range("C11").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,2,FALSE)"
Range("C13").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,3,FALSE)"
Range("C15").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,4,FALSE)"
Range("C17").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,5,FALSE)"
Range("C19").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,6,FALSE)"
Range("C21").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,7,FALSE)"
Range("C23").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,8,FALSE)"
Range("C25").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,9,FALSE)"
Range("C27").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,10,FALSE)"
Range("C29").Formula = "=VLOOKUP(""" & Stringd & """,Hidden!$A$2:$K$134,11,FALSE)"

End Sub

-------------------


The 'Hidden' window is shown in a screenshot, this just takes it
values it needs by refferencing the different cells on othe
spreadsheets and is a spreadsheet where all the data is collated s
that this report im trying to do will work.

So so far i can see how many times an employee has been off sick, but
need to know if its possible to show the dates of those times.

If anyone can help that would be greatly appreciated.

Many thank

+-------------------------------------------------------------------
|Filename: hidden.jpg
|Download: http://www.excelforum.com/attachment.php?postid=4121
+-------------------------------------------------------------------

--
alymcmorlan
-----------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...fo&userid=2765
View this thread: http://www.excelforum.com/showthread.php?threadid=49331

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Looking up dates


why use code at all?

change your formula to accept input from a cell
then put a datavalidation with lookup on that cell
to show the employee names.

since the employeenames are not on the same sheet
you must define a (global) name for the employee list
before creating the datavalidation.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


alymcmorland wrote :


Hi,

i have a table as shown in the attached picture. Its a registeration
database built in excel.

Is it possible to have a report on a seperate spreadsheet which when
the user puts in a name it'll match to the name on this spreadsheet
and return the dates for when an employee is off sick or on holiday
or late and so on.

So say i wanted to know mr x's sick days, it would have to find his
sick boxes, (which are red with an S) under his name and return the
values in the first column which is the dates.

Is this possible?

So far i have this code which will look up the amount of times someone
is off sick or whichever:


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Looking up dates


how would i go about doing that?


--
alymcmorland
------------------------------------------------------------------------
alymcmorland's Profile: http://www.excelforum.com/member.php...o&userid=27652
View this thread: http://www.excelforum.com/showthread...hreadid=493316

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Looking up dates



1. Insert Names/ Define
e.g.
EmpTable for the range Hidden!a2:k134
EmpNames for the range Hidden!a2:a134

(you can make this "dynamic range names"
google on that term should give you some examples.


2. in a free cell on your "input sheet"
e.g. C5

Data/Validation
Allow LIST
Check INCellDropdown
Source =EmpNames (name as defined above, be sure to include the =)

3. Enter your VLookup Formulas in C9: C29
=Vlookup($c$5,EmpTable,1,0)

Done.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


alymcmorland wrote :


how would i go about doing that?

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
Linking computer dates (time) to spreadsheet dates that have formu bigisle Excel Worksheet Functions 3 January 3rd 10 08:05 PM
Toggle a range of Julian dates to Gregorian Dates and Back PSKelligan Excel Programming 4 May 8th 07 05:51 AM
Identifying unique dates in a range of cells containing dates... cdavidson Excel Discussion (Misc queries) 4 October 13th 06 03:30 PM
need to convert list of dates to count no. of dates by week neowok Excel Worksheet Functions 13 January 30th 06 03:54 PM
Calculating number of days between two dates that fall between two other dates [email protected] Excel Discussion (Misc queries) 5 October 26th 05 06:18 PM


All times are GMT +1. The time now is 06:46 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"