Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

need macro to add 100 years to a selected range.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aligatrjoe - 25 Sep 2007 22:36 GMT
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.
Signature

Bill W

Chip Pearson - 25 Sep 2007 22:42 GMT
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

Signature

Cordially,
Chip Pearson
Microsoft MVP  - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

> 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.
aligatrjoe - 26 Sep 2007 00:04 GMT
Thank you very much.  Worked like a champ.  Really appreciate you and all the
others taking time to help us beginners.
Signature

Bill W

> Try something like
>
[quoted text clipped - 10 lines]
> > 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.