• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 58
  • Last Modified:

Vba and formula to change date

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
Jagwarman
Asked:
Jagwarman
  • 2
  • 2
1 Solution
 
Rgonzo1971Commented:
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

Open in new window

Regards
0
 
Rgonzo1971Commented:
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

Open in new window

0
 
JagwarmanAuthor Commented:
brilliant many thanks
0
 
JagwarmanAuthor Commented:
Rgonzo you are really one of the best.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now