View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ulrik Gustafsson Ulrik Gustafsson is offline
external usenet poster
 
Posts: 9
Default Date and sequential serial numbers

Hi,

Dim startdato as date instead - and it will work like a charm.
I have also included how you can convert the date to serial if you should
need it...

Sub TestTheDate()

Dim startdato As Date
Dim dblStartDatoSerial As Double

startdato = Range("Date").Value + 1

MsgBox startdato

' Convert startdato to serial if you should need that
' you can also use the DATE worksheet function for this.
dblStartDatoSerial = CDbl(startdato)

MsgBox dblStartDatoSerial

End Sub

Hope this helps

/Ulrik

"Peter B" wrote in message
...

I have dimmed startdato as Integer and would simply add 1. The line that

doesnt work is this one:
Startdato = Range("Date").Value + 1

When I am trying to do this, I get the message:
"Run-time error '6':

Overflow"

Any suggestions?

Peter