Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am new to VBA/macros, but have create one that prints a series of documents
that are needed each month out of the folders for each month (i.e. Nov, Dec, Jan). I would like to add to the beginning of the code, a find and replace function so that I don't have to go into the code prior to running the macro, find and replace Feb with Mar, Mar with Apr, etc. I imagine it would have something to do with having an input box where I would enter Mar or Apr and it would run the find and replace, but I don't know what the code would look like. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
By using parametrs you avoid Find/Replace. Say you have code like:
Sheets("Apr").Activate Find/Replace would result in something like: Sheets("May").Activate Instead: Dim s As String s = Application.InputBox(Prompt:="Enter month:", Type:=2) Sheets(s).Activate This avoids the editting. -- Gary''s Student - gsnu200835 "Kevin" wrote: I am new to VBA/macros, but have create one that prints a series of documents that are needed each month out of the folders for each month (i.e. Nov, Dec, Jan). I would like to add to the beginning of the code, a find and replace function so that I don't have to go into the code prior to running the macro, find and replace Feb with Mar, Mar with Apr, etc. I imagine it would have something to do with having an input box where I would enter Mar or Apr and it would run the find and replace, but I don't know what the code would look like. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find and Replace within workbook - from Visual basic | Excel Programming | |||
help for Visual Basic Find | Excel Programming | |||
Using FIND in Visual Basic | Excel Programming | |||
Where do I find help for Visual Basic for Applications Extensibili | Excel Programming | |||
Using Find/Replace in Visual basic to adapt the code | Excel Programming |