LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Simple Macro

Hi, I have recorded a simple Macro as such:
Sub F_R()
'
' F_R Macro
' Macro recorded 4/25/2004 by VSC
'

'
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Replace What:="97", Replacement:="98", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

I would like to modify it so that "98" is replaced by "97 +1" and "97"
should be whatever year or numbers are found in cell A1 for example.
I have a values in cell A1 as such: MNH97,D.
I need the macro to look for the only digits in cell A1 i.e. 97 and replace
with value (digits) +1 so result is MNH98,D, etc. (independent of the year
number i.e. if year is 71 then results is 72)

How do I modify above macro or rewrite it?

Tx a million.
S


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple macro MikeD1224 Excel Discussion (Misc queries) 1 June 9th 07 12:06 AM
Simple Macro John Excel Worksheet Functions 1 November 17th 06 05:16 PM
a simple macro? asalerno Excel Discussion (Misc queries) 2 April 28th 06 12:45 AM
Simple macro help chip_pyp Excel Discussion (Misc queries) 3 January 10th 06 07:57 PM
Simple macro - help please!! Micheal Excel Programming 2 October 24th 03 04:30 PM


All times are GMT +1. The time now is 09:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"