Okay, About to pack it all up and Chuck it out the window, but I am attempting a userform to aid with updating a workbook. The ONLY problem I have is getting to any of a set of cells. I can Locate the Cells via Code, and have been trying to put the strings in, but I am hitting a brick wall. This code looks at 1 text box (lName Dim Enm) and 1 combobox (EMonth Dim Mhr)
I set the range for the find for both Criteria, and when the code borks out, the References are correct (intersection of row CR, and Column CC (Where CR and CC DO correspond to the correct row and Column)
I am working this button so when a person clicks the button, the Number in a third text box is placed on the spreadsheet at this position. (that part is easy-peasy)
Can Anyone tell me where I slipped a digit?
Private Sub UpdateHours_Click()
Dim MHr As String
Dim CR As String
Dim CC As String
Dim ENm As String
ENm = Me.LastNm
MHr = Me.EMonth
Set rRange = Range("c2:c100").Find(What:=ENm)
If rRange Is Nothing Then
GoTo ErrHan
Else: CR = rRange.Row
End If
Set cRange = Range("l1:w1").Find(What:=MHr)
If cRange Is Nothing Then
GoTo ErrHan
Else: CC = cRange.Column
Cells(CR, CC).Select
End If
Exit Sub
ErrHan: MsgBox "Not Found"
End Sub
Bookmarks