How to insert current date into find replace macro?

Sheesha1984

New Member
Joined
Feb 15, 2022
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
I'm creating a mail merge and depending on the state in my excel report part of the naming convention of my finished document needs to be different. I have a simple find replace macro I've modified that would convert the state in each row to the proper identifier. I haven't run the find replace yet. The identifiers don't change. In my example it's only CA that is slightly different. After I've done my find replace I'd like to add the account ID and the current date and populate the entire name into another column. I was figuring some kind of concatenate formula but I'm not sure how to get whatever the current date is and then build it into the find replace macro I have.

Once I have my completed data in the mail merge spreadsheet I create my letter and then before I finish the last step of the merge I run a macro in Word that takes the information in columns L and M to create a copy in Word and column N and O to create a pdf copy. I update the folder path column to fit my needs for that day.

Can someone help me automate the file naming process? Hopefully this makes sense. Thanks!
 

Attachments

  • RenameMacro.PNG
    RenameMacro.PNG
    18 KB · Views: 7

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Maybe "C:\VBA testing 12345_XXXXX_" & Date() & ".pdf"
or change the values to cell references?
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,091
Latest member
gaurav_7829

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