Hi,
When running my code, i keep getting a compile error - Else without if, and it highlights the Else in the middle of the attached. Any ideas why it doesn't want to work? There is definitely an if at the start..
It's part of a larger code that when you click submit on a user form, it puts the data from the "PHE_DateText" box, into a variable cell range based on which BadgeID had been selected.
When running my code, i keep getting a compile error - Else without if, and it highlights the Else in the middle of the attached. Any ideas why it doesn't want to work? There is definitely an if at the start..
It's part of a larger code that when you click submit on a user form, it puts the data from the "PHE_DateText" box, into a variable cell range based on which BadgeID had been selected.
VBA Code:
If PHE_DateText.Value = "" Then Worksheets("Badge Log").Range("K" & BadgeLocation) = ""
Else
Worksheets("Badge Log").Range("K" & BadgeLocation) = DateValue(PHE_DateText.Value)
End If