All I am trying to do is take a date, add one to the date, stick it in a worksheet and let the worksheet run a formulae on the entered date. The cells are all formatted as English dates but when I assign the cell's value with the below code it thinks the date it's being given is in American format even though it's already in English format and so tries to convert it to English format. How can I stop it from thinking in American?
I abandoned all VBA's functions and made a function to add one to the date because VBA was just giving me a headache.
Dim D, M, Y As String
Dim S1, S2, NewDay, NewMonth, NewYear As Integer
S1 = InStr(1, StartDate.Value, "/")
S2 = InStr(S1 + 1, StartDate.Value, "/")
Debug.Print (CStr(S1) + " " + CStr(S2))
D = Mid(StartDate.Value, 1, S1 - 1)
M = Mid(StartDate.Value, S1 + 1, S2 - S1 - 1)
Y = Mid(StartDate.Value, S2 + 1)
Debug.Print (D + " " + M + " " + Y)
NewDay = CInt(D) + 1
NewMonth = CInt(M)
NewYear = CInt(Y)
If NewDay > DaysInMonth(M, Y) Then
NewDay = 1
NewMonth = NewMonth + 1
If NewMonth > 12 Then
NewMonth = 1
NewYear = NewYear + 1
End If
End If
StartDate.Value = CStr(NewDay) + "/" + CStr(NewMonth) + "/" + CStr(NewYear)
then in another function I just set the cell's value like so
With sheet.Range("A2")
'.. Stuff
.Offset(i, 1) = StartDate.Value