Chunk
09-29-2016, 08:37 AM
For lack of being able to describe the root problem, here is what I want the user to be able to do:
From a userform
Select a project in a combobox
Depending on the project selected, the user will have a choice of dates, via another combobox (that come from a project worksheet, in the 'D' column staring at D3(variable number of dates per project))
When the date is selected, data from the worksheet will be added to the 25 or so textboxes on the userform.
I can get the project combobox to work with the date combobox.
The problem I am having is getting the date combobox to properly search the worksheet for the date, so I can use that position to populate the text boxes.
Here is the code I am using:
Private Sub cb_DDate_Change()
cb_DDate = Format(cb_DDate, "mm/dd/yyyy")
Call mod_DataEntry.DateChange
End Sub
Sub DateChange()
Dim ws
Dim Rng As Long
Dim FindString As Long
Set ws = ThisWorkbook.Worksheets(UF_Main.cbo_project.Value)
FindString = UF_Main.cb_DDate.Value
If Trim(FindString) <> "" Then
Set Rng = ws.Cells.Find( _
What:=FindString, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
UF_Main.tb_PercentDone.Text = Rng(1, 9)
End If
End Sub
I am receiving an Object Required error.
My forehead is starting to ache from the desk slamming. Please help.
Thanks in advance for your time.
Chunk
From a userform
Select a project in a combobox
Depending on the project selected, the user will have a choice of dates, via another combobox (that come from a project worksheet, in the 'D' column staring at D3(variable number of dates per project))
When the date is selected, data from the worksheet will be added to the 25 or so textboxes on the userform.
I can get the project combobox to work with the date combobox.
The problem I am having is getting the date combobox to properly search the worksheet for the date, so I can use that position to populate the text boxes.
Here is the code I am using:
Private Sub cb_DDate_Change()
cb_DDate = Format(cb_DDate, "mm/dd/yyyy")
Call mod_DataEntry.DateChange
End Sub
Sub DateChange()
Dim ws
Dim Rng As Long
Dim FindString As Long
Set ws = ThisWorkbook.Worksheets(UF_Main.cbo_project.Value)
FindString = UF_Main.cb_DDate.Value
If Trim(FindString) <> "" Then
Set Rng = ws.Cells.Find( _
What:=FindString, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
UF_Main.tb_PercentDone.Text = Rng(1, 9)
End If
End Sub
I am receiving an Object Required error.
My forehead is starting to ache from the desk slamming. Please help.
Thanks in advance for your time.
Chunk