Need to translate into VBA

insanity

New Member
Joined
Feb 1, 2007
Messages
19
Is there a way to translate the following cells and their formulas into VBA code? What I am trying to do is take the Julian date(the first 7 is the year and 037 the day) and time "7037/2310" and translate it into "06/2310", which would be the 6th of Feb at 23:10. Thanks for any help you can give.

Julian Date/Time in cell E2 "7037/2310"

Cell F2 "7037" (with formula) =LEFT(E2,4)

Cell G2 contains "2/6/2007" (with formula) =DATE(IF(0+(LEFT(F2,1))<30,2000,1900)+LEFT(F2,1),1,RIGHT(F2,3))

Cell H2 "06" (formula) =DAY(G2)

Cell I2 "2310" (formula) =RIGHT(E2,4)

Cell J2 "6/2310" =CONCATENATE($H2,"/",$I2)
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Translate in what way?
Code:
x = Split(Range("E2"), "/")

MyDateTime = DateSerial(Left(x(0), 1), 0, Mid(x(0), 2)) + TimeSerial(Left(x(1), 2), Mid(x(1), 3), 0)

MsgBox MyDateTime
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top