Combining Variables Into A Single Output Cell

C

Chergh

Hi Folks,

I've been working with some database data which stores the date as an
integer (a different integer to that which Excel uses). To calculate the day,
month and year I do the following calculations:

y = Fix(ActiveCell / 65536)
m = Fix((ActiveCell - (y * 65536)) / 256)
d = Fix((ActiveCell - (y * 65536)) - (m * 256))

I now want to combine d, m and y into a single cell in the format off
dd/mm/yyyy but don't have a clue how anyone able to help?
 
D

Don Guillett

vba help index
DateSerial Function


Returns a Variant (Date) for a specified year, month, and day.

Syntax

DateSerial(year, month, day)
 
C

Chergh

Thanks very much works perfectly :)

Don Guillett said:
vba help index
DateSerial Function


Returns a Variant (Date) for a specified year, month, and day.

Syntax

DateSerial(year, month, day)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top