0

I have this strange problem. When I use this function

Worksheets("Worksheet").Cells(2, 8).Value = ComboBox2.Value 

Where my ComboBox2.Value = 02/01/2019 I got the following output in Cells(2,8) --> 01/02/2019

But in my cell properties I have already set that I want "dd/mm/yyyy"

Where is the problem?

9
  • 1
    Probably in your Regional settings in your computer system, got some issues with that. Commented Oct 2, 2019 at 12:25
  • Does using .Value2 change anything? Commented Oct 2, 2019 at 12:25
  • @M.Schalk No it doesn't change anything Commented Oct 2, 2019 at 12:27
  • @SometingNew Keep ComboBox2.Value as it is, use .Value2 for the cell Commented Oct 2, 2019 at 12:28
  • how do you set the combobox values? Commented Oct 2, 2019 at 12:29

1 Answer 1

3

i would convert to a date the combobox value. tried (replicated) your issue and this fix worked for me. basically, use CDate to set the cell value.

Private Sub ComboBox1_Change() Dim v As Variant Dim d As Date v = Me.ComboBox1.Value d = CDate(v) Sheet3.Range("A1").Value = d End Sub 
Sign up to request clarification or add additional context in comments.

1 Comment

obviously, change/rename accordingly :-)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.