Cross Referencing nightmare

Watchdawg

Board Regular
Joined
Jan 21, 2015
Messages
84
Hopefully someone can help me with this! I have a spreadsheet that tracks employee's attendance points. There is a tab for 2013, 2014, etc.
The employee names are in Row 2 - B2:Y2
The dates are in column A broken up by month
My userform has 3 areas, Name, Date, and points accrued.
When I click "Save", i need it to find the employee's name, match it up with the date, and populate that cell with the points accrued that was entered on the form.
Example: Employee 1 (B2), got 1 point on January 18. When I click save, B22 (1st employee 18th of January) now should read 1.

Any ideas?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I have done something like this in the past, I don't use a userform but maybe you can use some of the code for your purposes.
This is an example of my sheet:
ABCDEF
1NameEm2
2Date12/12/16Button
3Points3
4
5DatesEm1Em2Em3Em4Em5
612/12/163
712/19/16

<tbody>
</tbody>

In Cell B1 I have a drop down of all employees, B2 has data validation to only accept dates listed on that sheet.

So you enter info in B1, B2, B3 then click the Button and it populates the matrix. The code is:
Code:
Sub Button2_Click()

Dim Employee As String
Dim Date1 As Date
Dim Points As Double

Employee = Range("B1")
Date1 = Range("B2")
Points = Range("B3")

colnum = Range("B5:L6").Find(Employee).Column
rownum = Range("A6:A30").Find(Date1).Row

Cells(rownum, colnum) = Points


End Sub
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,796
Members
448,994
Latest member
rohitsomani

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