Hi,
I have a problem with date formatting when exporting data from userform data into worksheet. When I export the worksheets automatically think that the date is text. The problem starts when I use Pivot table and excel dont formate it into correct formate (date) . I want the date to be dd.mm.yyyy.
Please help me. I`m unable to define the variable correctly. I have tried to Dim .... As Date, but it won't work
This is my code
'Aktiverer fengslingsliste
Sheets("Fengslingsliste").Activate
'definerer emptyrow
emptyrow = WorksheetFunction.CountA(Range("A:A")) + 1
'Finner korrekt informasjon
Cells(emptyrow, 1).Value = txvfd.Value
Cells(emptyrow, 2).Value = txbSnr.Value
Cells(emptyrow, 3).Value = txbEtternavn.Value
Cells(emptyrow, 4).Value = jurist.Value
Cells(emptyrow, 5).Value = etterforsker.Value
Cells(emptyrow, 6).Value = lovo.Value
Cells(emptyrow, 7).Value = parnr.Value
Cells(emptyrow, 8).Value = fv.Value
Cells(emptyrow, 9).Value = "1"
Cells(emptyrow, 10).Value = txbfd.Value
'Får txtboks som sier ok
MsgBox ("Registrering vellykket")
'Sletter data
txbfd.Value = ""
txbSnr.Value = ""
txbEtternavn.Value = ""
jurist.Value = ""
etterforsker.Value = ""
lovo.Value = ""
parnr.Value = ""
fv.Value = ""
txbft.Value = ""
Bookmarks