Calculate This Friday's date and reformat VB

tvman5683

Board Regular
Joined
Mar 23, 2009
Messages
94
Hello,

I'm trying to identify an excel file (that I append to) that changes name every week on Friday. I found a few example that will correctly calculate next Friday's datebut I need to change the format to match the excel format. File is saved as Mysheet 01-15-16.xls. The code below returns 1/15/2016.
any help would be greatly appreciated.


HTML:
NextFriday = Format(Date + 8 - Weekday(Date, vbFriday), dd - mm - yy)
 
fyi, you had it right the first time. No need for the replace even though it also worked perfectly!
Sorry, I forgot to mention that part. Yes, when you change the variable declaration to String, there then is no need to use the Replace function.
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,221,829
Messages
6,162,229
Members
451,756
Latest member
tommyw

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