Solved

Vba and formula to change date

Posted on 2016-10-18
4
42 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
Comment
Question by:Jagwarman
  • 2
  • 2
4 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
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

Open in new window

Regards
0
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 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

Open in new window

0
 

Author Comment

by:Jagwarman
ID: 41848258
brilliant many thanks
0
 

Author Closing Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Formula fix for vlookup and iserror 3 23
Excel Data Validation Help 9 40
Excel formula that pulls back the id 4 39
macro to compare 2 Excel columns. 14 21
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

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

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

Join & Ask a Question