VB question

tim963

Board Regular
Joined
Aug 20, 2002
Messages
58
Hi I need a line of code to put January 1 of the current year in G3, so if the Marco was run today it would put 1-1-2002 in G3, if it was run next year it would put 1-1-2003 in G3. Can this be done? Thanks, using excel ‘97
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I would suggest posting your failed attempts at creating the code. We can then offer guidance as to achieving your goal.
 
Upvote 0
I think this will work.
Range("G3").Value = "1/1" & YYYY
Custom format cell with this, m-d-yyyy

_________________
Win 98SE - Office 2K
This message was edited by dsnbld on 2002-08-28 18:00
 
Upvote 0

Forum statistics

Threads
1,203,096
Messages
6,053,510
Members
444,669
Latest member
Renarian

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