Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Vba and formula to change date

Posted on 2016-10-18
Medium Priority
49 Views
Last Modified: 2016-10-18
Can an expert help me out with this,

Looking for code that will find the first date in column N and change it from whatever date is there to that date plus 1

Many thanks
0
Question by:Jagwarman
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• Learn & ask questions
• 2
• 2
4 Comments

LVL 52

Expert Comment

ID: 41848231
HI,

pls try
``````Sub Macro()
For Each c In Range(Range("N1"), Range("N" & Rows.Count).End(xlUp))
If IsDate(c) Then
c.Value = c.Value + 1
Exit For
End If
Next
End Sub
``````
Regards
0

LVL 52

Accepted Solution

Rgonzo1971 earned 2000 total points
ID: 41848236
If you have to add one day to the formula then try
``````Sub Macro1()
For Each c In Range(Range("N1"), Range("N" & Rows.Count).End(xlUp))
If IsDate(c) Then
c.Formula = c.Formula & "+ 1"
Exit For
End If
Next
End Sub
``````
0

Author Comment

ID: 41848258
brilliant many thanks
0

Author Closing Comment

ID: 41848262
Rgonzo you are really one of the best.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
###### Suggested Courses
Course of the Month11 days, 8 hours left to enroll

#### 718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.