scottrssll
New Member
- Joined
- Jan 8, 2016
- Messages
- 11
Hello, Everyone!
I have an issue that I desperately need help with. My boss told me to do this a while ago, and I have been struggling tremendously...
I need to make an interactive spreadsheet (table) of employees. Each row will have a different employee, while each column will have a different type of technical error. I want to be able to click on any cell and input data when an employee makes an error and see any past errors made or reset them (no more than 3 allowed). Finally, when I look at the table, it should only show a color for each cell representing the number of errors. Right now my table says "Good" or "Write Up," and I don't like this.
When trying to do this myself, I started by referencing three cells on sheet 2 for each cell on sheet 1 (the table) and using the formula "=IF(AND(ISTEXT(Sheet2!B1),ISTEXT(Sheet2!B2),ISTEXT(Sheet2!B3)),"WRITE UP","GOOD")" Then I tried to write code (which I'm horrible at) that would log input data in the appropriate reference cells with an input box when you click on a cell in the table. It isn't going well.
Here's an example of my table:
[TABLE="width: 527"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Safety[/TD]
[TD]Breaks[/TD]
[TD]Phone[/TD]
[TD]FTC[/TD]
[TD]SOP[/TD]
[TD]Other[/TD]
[/TR]
[TR]
[TD]BOB JONES[/TD]
[TD]WRITE UP[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[TD]WRITE UP[/TD]
[TD]GOOD[/TD]
[/TR]
[TR]
[TD]KIM CARDIO[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[TD]WRITE UP[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[/TR]
</tbody>[/TABLE]
Here's my horrible code so far:
Someone please save me!!!
Thanks!
I have an issue that I desperately need help with. My boss told me to do this a while ago, and I have been struggling tremendously...
I need to make an interactive spreadsheet (table) of employees. Each row will have a different employee, while each column will have a different type of technical error. I want to be able to click on any cell and input data when an employee makes an error and see any past errors made or reset them (no more than 3 allowed). Finally, when I look at the table, it should only show a color for each cell representing the number of errors. Right now my table says "Good" or "Write Up," and I don't like this.
When trying to do this myself, I started by referencing three cells on sheet 2 for each cell on sheet 1 (the table) and using the formula "=IF(AND(ISTEXT(Sheet2!B1),ISTEXT(Sheet2!B2),ISTEXT(Sheet2!B3)),"WRITE UP","GOOD")" Then I tried to write code (which I'm horrible at) that would log input data in the appropriate reference cells with an input box when you click on a cell in the table. It isn't going well.
Here's an example of my table:
[TABLE="width: 527"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Safety[/TD]
[TD]Breaks[/TD]
[TD]Phone[/TD]
[TD]FTC[/TD]
[TD]SOP[/TD]
[TD]Other[/TD]
[/TR]
[TR]
[TD]BOB JONES[/TD]
[TD]WRITE UP[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[TD]WRITE UP[/TD]
[TD]GOOD[/TD]
[/TR]
[TR]
[TD]KIM CARDIO[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[TD]WRITE UP[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[TD]GOOD[/TD]
[/TR]
</tbody>[/TABLE]
Here's my horrible code so far:
Code:
Option Explicit
Sub TransgressionLog_Click(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("D4")) Is Nothing Then
If IsText(Sheet2!D1) And IsText(Sheet2!D2) And IsText(Sheet2!D3) Then
Response = MsgBox("Has the counseling been completed?", vbYesNo, "Reset Counseling")
If Response = msgboxresult.yes Then
Sub sbClearCellsOnlyData()
Range("Sheet2!d1:Sheet2!d3").ClearContents
End Sub
Else
Response = MsgBox("Councelling Must Be Completed To Reset Strikes", vbOKOnly, "Reset Counseling")
End If
Else
Dim strTransgression$
Dim sw1 As Boolean
strTransgression = InputBox("Please Describe the Infraction", , "Transgression Report")
vbOKOnly
With Sheets("2")
lngLstRow = .UsedRange.Rows.Count + .UsedRange.Row
.Range("d1:d3" & lngLstRow).Value = strUserName
End With
MsgBox "Transgression Successfully Added!", _
vbExclamation + vbOKOnly, _
"Added!"
End If
myEnd:
End Sub
End If
End If
End If
End Sub
Someone please save me!!!
Thanks!
Last edited by a moderator: