Hi there
I have a query that I am slightly puzzled by (I know this will seem like a day 1 beginners question for you).
I am using a userform with 4 textboxes to extract information from a worksheet using information in textbox 1. 1 box looks up a date but returns the date in numerical format (42682) instead of dd/mm/yyyy. The date is formatted correctly in the worksheet, but will not extract correctly to the userform. The code I'm using is:
If WorksheetFunction.CountIf(Sheet1.Range("D:D"), Me.KSTextBox.Value) = 0 Then
MsgBox "This Knowledge Article does not exist"
Me.KSTextBox.Value = ""
Exit Sub
End If
With Me
.DateTextBox = Application.WorksheetFunction.VLookup(Me.KSTextBox, Sheet1.Range("D2:K1000"), 4, 0)
.SkillTextBox = Application.WorksheetFunction.VLookup(Me.KSTextBox, Sheet1.Range("D2:K1000"), 6, 0)
.VersionTextBox = Application.WorksheetFunction.VLookup(Me.KSTextBox, Sheet1.Range("D2:K1000"), 8, 0)
End With
End Sub
I tried this code after the With Me command -
copy to clipboard
.DateTextBox = Application.WorksheetFunction.VLookupCDate(Me.KSTextBox), Sheet1.Range("D2:K1000"), 4, 0)
but this returns a fault on this code line
Bookmarks