jaslake
Everything running beautiful! Thanks heaps.
I have done a lot since last post. Main thing is I created custom forms for each of the sheets. All forms have date text boxes. I like it to be like the Modify Form. What is the code so that the calender places the entry to the textbox enter event? Can I call the same Calender for seperate forms or do I need multiple calender in each form?
Can I just copy and paste this code:
Private Sub TextBox1_Change()
Dim myName As String
sYear = Year(Me.TextBox1.Value)
sMonth = WorksheetFunction.Text(Me.TextBox1.Text, "mmm")
Set ws1 = Sheets("Roster2012")
With ws1
Set myRng = .Range(sMonth & "_" & sYear)
myName = Me.ComboBox1.Value
myDate = Format(Me.TextBox1.Value, "dd/mm/yyyy")
Set myCol = myRng.Rows(1).Find _
(what:=DateValue(myDate), LookIn:=xlFormulas)
On Error Resume Next
Set myRow = .Columns(1).Find(what:=myName, After:=.Cells(myRng.Rows(1).Row, 1), LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
On Error GoTo 0
If Not myRow Is Nothing Then 'Application.Goto myRow, True
Me.TextBox2.Value = Intersect(myRow.EntireRow, myCol.EntireColumn).Value
End If
End With
End If
EventsOff = False
SendKeys "{TAB}"
End Sub
The date format should be dd/mm/yy when inserted in textbox field.
Bookmarks