Making a path and filling in the date.

Romano_odK

Active Member
Joined
Jun 4, 2020
Messages
379
Office Version
  1. 365
Platform
  1. Windows
Good evening,

In my sheet there is a macro that makes an XML file especially for the software I work with. This XML needs to be written to a specific folder with a specific name. That being said, I need with the press of a button that in a cell the the text C:\Temp\yyyy-mm-dd-IKP.XML is written. The fun part is that the yyyy mm dd are indeed the current year, month and day. Is it possible to do this?

The software I use will be able to read our this date and import it on the specific date. This is now done manually. Can this be done using VBA or should I turn to Excel?

Thank you for your help

Kind regards,

Romano
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
=TEXTJOIN("-",,YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()),"IKP.XML") will return what you mention for the filename piece.
 
Upvote 0
Another option is
Excel Formula:
="C:\Temp\"&TEXT(TODAY(),"yyyy-mm-dd")&"-IKP.XML"
 
Upvote 0
=TEXTJOIN("-",,YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()),"IKP.XML") will return what you mention for the filename piece.
Thank you for your reply, this works great.

Have a nice day.

Romano
 
Upvote 0
Another option is
Excel Formula:
="C:\Temp\"&TEXT(TODAY(),"yyyy-mm-dd")&"-IKP.XML"
Good evening,

As the above solution, this also works great. Thank you for your reply.

Have a nice day,

Romano
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,062
Messages
6,122,925
Members
449,094
Latest member
teemeren

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