Two Questions : Between Times & Excel Versions

Derek_35

New Member
Joined
Apr 21, 2002
Messages
25
Two quick questions...

A) A file I am opening updates everyday at noon & the end of the filename is the day of the month it was updated.

April 26th
Filename = test26

I have no problems if the user runs my macro on the 26th because it inserts the day. The problem I am having is if the user runs the macro in the morning of the 27th. 27 inserts at the end of the filename, rather than the 26 that I need.

How would I code this since I want the day to equal the 26th if it is After 12pm EST on the 26th and before 12pm EST on the 27th.

B) Is there a way to determine which Excel version the user is running? Users of my programs are running anywhere from version 97 through XP.

Thanks, Derek_35
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
For your second question,

test
Application.Version

to determine the Excel app running.

I don't know all the codes, but
8.0 -- Excel 97
9.0 -- Excel 2000
10.0 -- Excel XP

Use Val(Application.Version) because there are different releases that get different version numbers.

On my system, Msgbox Application.Version returned 8.0j

HTH,
Jay
 
Upvote 0
Derek,

adding to Jay's VBA method, the formula approach would be :

=INFO("release")

will will return the "Version of Microsoft Excel, as text."
 
Upvote 0

Forum statistics

Threads
1,213,490
Messages
6,113,956
Members
448,535
Latest member
alrossman

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