need macro to add 100 years to a selected range.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Really having trouble with objects. Can't seem to navigate through a
selected range and then edit a date cell. Thanks to others I have made
progress. I can change one selected cell, but not a selection of cells.
 
Try something like

Dim Rng As Range
For Each Rng In Selection.Cells
With Rng
If IsDate(.Value) = True Then
.Value = DateSerial(Year(.Value) + 100, Month(.Value), Day(.Value))
End If
End With
Next Rng



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
Thank you very much. Worked like a champ. Really appreciate you and all the
others taking time to help us beginners.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top