Please help. Vlookup thing..not sure
Closed
Please help! I have a schedule@ which looks like this. In sheet1 A2:A13 has names of workers. B2:B30 has dates in serial wise. B3:S13 has the shift timings or text "L" for people on Leave and text "W off" for people on week offs. I want the formula to be entered in sheet1 A15 or macro.
1. When I run the formula/macro for the date example "4/3/2010" in the A15 or macro button, I want list of names comes in serial wise from A16.
2. Which means it will display the name of people who is present or will be present on that particular day.
Thanks a lot.
1. When I run the formula/macro for the date example "4/3/2010" in the A15 or macro button, I want list of names comes in serial wise from A16.
2. Which means it will display the name of people who is present or will be present on that particular day.
Thanks a lot.
Related:
- Please help. Vlookup thing..not sure
- Transfer data from one excel worksheet to another automatically vlookup - Guide
- Excel 2007 Using vlookup function in VBA ✓ - Excel Forum
- Using Vlookup to return insted of 00/01/1900 ✓ - Excel Forum
- Removing "FALSE" from an IF statement with a VLOOKUP ✓ - Excel Forum
2 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 3, 2010 at 01:23 PM
May 3, 2010 at 01:23 PM
Why not just apply filter to see the list ?
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 4, 2010 at 09:52 AM
May 4, 2010 at 09:52 AM
Not entirely sure how this search will occur. This should give you a good idea
Sub SearchSchedule() Dim sScheduleSheet As String ' Name of schedule sheet Dim sSearchSheet As String ' Name of search sheet Dim lSchedNameStartRow As Long ' Row where the names on schedule sheet start Dim iDateCol As Integer ' Column where the searched date is located on schedule sheet Dim sSearchString As String ' The date entered on search sheet and is to be searched Dim lScheduleRow As Long ' A row counter for schedule Dim lSearchRow As Long ' A row counter for schedule Dim sScheduleName As String ' the name scheduled Dim sScheduleDate As String 'The value of schedule time sScheduleSheet = "Schedule" ' Name of schedule sheet sSearchSheet = "Sheet1" ' Name of search sheet lSchedNameStartRow = 6 ' Row where the names on schedule sheet start sSearchString = Sheets(sSearchSheet).Range("C2") ' The date entered on search sheet and is to be searched ' Column where the searched date is located on schedule sheet iDateCol = 0 On Error Resume Next iDateCol = Sheets(sScheduleSheet).Cells.Find(sSearchString, Cells(1, 1), SearchOrder:=xlByRows, SearchDirection:=xlNext).Column On Error GoTo 0 ' if the date is found If (iDateCol > 0) Then lScheduleRow = lSchedNameStartRow ' lSearchRow = 2 ' sScheduleName = Sheets(sScheduleSheet).Cells(lScheduleRow, "A") ' loop thru while the there is a non-blank column is encountered Do While (sScheduleData <> "") sScheduleDate = Sheets(sScheduleSheet).Cells(lScheduleRow, iDateCol) If ((sScheduleDate <> "L") And (sScheduleDate <> "WOFF")) Then Sheets(sSearchSheet).Cells(lSearchRow, "A") = sScheduleName lSearchRow = lSearchRow + 1 End If 'increase count by one lScheduleRow = lScheduleRow + 1 sScheduleName = Sheets(sScheduleSheet).Cells(lScheduleRow, "A") Loop Else MsgBox ("Date " & sSearchString & " not found.") Exit Sub End If End Sub
May 4, 2010 at 07:16 AM
May 4, 2010 at 07:51 AM
May 4, 2010 at 08:11 AM
May 4, 2010 at 08:18 AM
Please click the sheet. In sheet 1 in C2 I want the formula or the macro that can give me a list of people present on particular date (when i eneter the date. I hope you understand, thanks alot.
May 4, 2010 at 08:24 AM