VBA Code to Search and produce results based on the criteria

Balajibenz

Board Regular
Joined
Nov 18, 2020
Messages
80
Office Version
  1. 2013
Platform
  1. Windows
Hi, Can someone help me with the below requirement.

I have data as below in the sheet1 of workbook1.

Team RegionEmployee NameCurrent ManagerTS/GS26-Jul27-Jul28-Jul29-Jul30-Jul31-Jul01-Aug02-Aug03-Aug04-Aug05-Aug06-Aug07-Aug08-Aug09-Aug10-Aug11-Aug12-Aug13-Aug
CXYrYvYnYn XhYnmugYm
CHYrXh YgrYwYl
BXX YYYXNZ & SXXNZ & SX
BKYrthick XYkthivelX - XLH - Mulesoft IntX UMNX - XXlXxy - SDS (UXT, LXX InstXll, Xo Live & Support)NX - PM - WXllet/WCM Xo LiveNX - TeXm mXnXXement / NX - MXp Conversion PlXnninX / NX - Process ImprovementVXcXtionX - XLH - Mulesoft IntX UMNX - XXlXxy - SDS (UXT, LXX InstXll, Xo Live & Support)NX - PM - WXlletNX - TeXm mXnXXement / NX - MXp Conversion PlXnninX / NX - Process ImprovementX - XLH - Mulesoft IntX UMNX - XXlXxy - SDS (UXT, LXX InstXll, Xo Live & Support)NX - PM - WXlletNX - TeXm mXnXXement / NX - MXp Conversion PlXnninX / NX - Process Improvement
BKiXhore KumYr KYppuriX - XLH - Mulesoft IntX UMX - XLP - Xo LiveX - XLH - Mulesoft IntX UMX - Skycity - MultiprotocolVXcXtion
DXrinivYXYn MYniX - XLH - XooXle SheetsX - XLH - XooXle SheetsX - XLH - XooXle Sheets
DYnYXuyYmmY RYnjith KumYrNX - TXXleu TrXininXX - XLP - Xo LiveX - Peermont - XI InteXrXtionNX - XS - Tech Support
DXindhu VenkYteXhXI SRs L2 SupportNX - TXXleu TrXininXXI SRs L2 SupportXI SRs L2 Support
CPrYdeep PrYbhuXI SRs L2 Support / VenetiXn EXS ShXdowNX - TXXleu TrXininXX - XLH - WXllet CRSX - XLH - WXllet CRS
ARYkeXh MYrwYhYXsiX ProjectsXsiX ProjectsXsiX Projects
AXrihYri RYmYnX - Peermont - HUX X - XX R6 - JDT EnhXncementNX - PCS / NX - TeXm MXnXXementX - Peermont - HUX X - XX R6 - JDT EnhXncementNX - PCS / NX - TeXm MXnXXementX - Peermont - HUX
AXhubhYm VermYX - XLP - Xo LiveNX - SJM - HUX enhXncementsX - Peermont - HUX X - Peermont - HUX
AYbinYyY XrirYngYnX - XX R6 - JDT EnhXncementX - XLP - Xo LiveNX - XX R6 - JDT EnhXncementNX - XLP - Post Xo Live IssueNX - XX R6 - RetrofitsVXcXtion
AXuXhmithY BYbuX - XLH - WXlletX - XLH - WXlletX - XLH - WXllet
X - CXC - LFV MXpNX - XXlXxy - HUX UXT Cycle 4NX - XXlXxy - UXT CMP/CXXE/TV TriXXeNX - XXlXxy - UXT CMP/CXXE/TV TriXXe



It basically has skills, Resource names and their allocation based on the date. In reality the sheet has data for around 200 resources.

I am looking for a VBA code that gives the result as available resources based on the search criteria


In the sheet2 of the same workbook i need below things to be done.

Skill
Tentative Start Date
Tentative End Date
Total Man-days
FIND
ResourceAvailable Start DateDays AvailableCurrent Project


First I will explain how to read data in first sheet, it basically has skills, Resource and project names they are allocated to.
there will be color coding for each project but we should look for blank , grey and red colored cells.

Blank - Resource is available for the particular dates
Grey(RGB(128,128,128) and Hex - #808080) - Resource is tentatively booked
Red(RGB(255,0,0) and Hex - #FF0000) - Vacation

Here is my requirement

1. In Sheet2 I need to have a search criteria where in Skill field must be a dropdown which should have list of unique skills from Column A of sheet1
2. Start and end date column should have a option to select the dates
3. Man days column will be a manual entry
4. Let us say I have selected a Skill "A" and start and end dates are 01-Aug-2021 to 01-Sep-2021 and once i click on the find it should give me the result by looking in to the resource allocation in sheet 1 with information as resource name, Available start date and days he is available within the start and end date(Need to exclude weekends and Vacation which are red colored ones) and the Project they will be working before the requested start date.
5. In case of there are multiple resources available then they should be listed in terms of first available start date when compared to the start date given in the search
6. This scenario should also consider Grey colored periods and in our results we highlight the name of the resource with the same Grey color indicating that resource is tentatively booked.
7. Search can also be done using the skill alone without entering any dates and in this case the results should be from the day of search + 6 months
8. User can also enter Skill and start date alone and in this case results must be published for Start date + 6 Months.

Thank you in advance.
 
Last edited:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,224,814
Messages
6,181,120
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top