Increment date and publish it in next cell

Balajibenz

Board Regular
Joined
Nov 18, 2020
Messages
80
Office Version
  1. 2013
Platform
  1. Windows
Hi Evryone,

I a new to VBA and trying to do a automation.

I Hav a user unput date which stored in a string "strdate". now i want a code that looks for the date in row 3 of sheet1 and if the date is present it has to publish strdate + 7 days in the immediate next cell to its right.

lets say user input is 10/17/2020 which is found to be in B3 then code has to put 10/24/2020 in C3. if date is not found it can ignore it.

Also if possible it has to publish the text in the format "XXX to Oct 24" in the cell C2. highlighted part of text has to be changed accoring to the date in the below cell. I am happy to have code for the first ask above.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi Evryone,

I a new to VBA and trying to do a automation.

I Hav a user unput date which stored in a string "strdate". now i want a code that looks for the date in row 3 of sheet1 and if the date is present it has to publish strdate + 7 days in the immediate next cell to its right.

lets say user input is 10/17/2020 which is found to be in B3 then code has to put 10/24/2020 in C3. if date is not found it can ignore it.

Also if possible it has to publish the text in the format "XXX to Oct 24" in the cell C2. highlighted part of text has to be changed accoring to the date in the below cell. I am happy to have code for the first ask above.
I was able to increment it using Dateadd method. can someone help me with the part - it has to publish the text in the format "XXX to Oct 24" in the cell C2. highlighted part of text has to be changed accoring to the date in the below cell
 
Upvote 0
I was able to increment it using Dateadd method. can someone help me with the part - it has to publish the text in the format "XXX to Oct 24" in the cell C2. highlighted part of text has to be changed accoring to the date in the below cell
No worries, able to figure out using - "YTD to " & Format(CDate(Range(Fdate2)), "MMM DD")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

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