Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

799.Advanced search and replace -- How to add one line after Sub or Function in the VBA Text File?

User: Gary W. Hill -- 2011-06-13          << 798  800 >>
Hits: 285
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
Add one line after Sub or Function in the VBA Text File.
This is the line I need to add:
'Program Written by Gary W. Hill
Input Sample:
Sub ValuesOnly()

Dim rRange As Range
On Error Resume Next
Set rRange = Application.InputBox(Prompt:="Select a Range", Title:="Values Only", Type:=8)
If rRange Is Nothing Then Exit Sub
rRange = rRange.Value
End Sub
Output Sample:
Sub ValuesOnly()
'Program Written by Gary W. Hill
Dim rRange As Range
On Error Resume Next
Set rRange = Application.InputBox(Prompt:="Select a Range", Title:="Values Only", Type:=8)
If rRange Is Nothing Then Exit Sub
rRange = rRange.Value
End Sub
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source VBA Text file
2. ctrl-h open 'replace' dialog
* set 'replace unit' to 'Line'
* check the option of 'Ignore Cases'
* set 'search for pattern' to:

* set 'replace with pattern' to:

3. click 'Replace', done.
4. ctrl-s save to file.

Note: 
* if you need to change multiple files, you can ignore step 1, and click "Batch ..." button at step 3, then drag multiple text file to "Batch Runner" window, and click "Batch Replace", done.
* Please make backup in advance to avoid mis-operation.

Screenshot 1:  Replace_Window


Similar Examples:
How to add a blank line after every 8 lines in text file? (63%)
How to add a single space after each character in a text file? (60%)
How to add a page number after every 40 lines in a text file? (59%)
How to insert a blank line after every 5 lines in a text file? (57%)
How to insert a line after specific lines in a text file? (55%)
How to add spaces to align text to the center in a text file? (55%)
How to add a <Return> after each period '.' in text file? (55%)
How to add 3 spaces after every 9 characters in a text file? (55%)

Check Demo of Advanced search and replace
Keywords:
vba  written  functions  backup  ignore  sub  after  function  case  operation  can make multiple search and replace  search backup replace  backup files  replace ignore  after text  replace text after  replace after  change text in multiple files