* Create your FREE website now *

Find and Replace

Tags:  

The following macro code used for find and replace value in the selected range.
Sub FindAndReplace()
Dim txt as String,replaceAs as String
txt = "Arun"
replaceAs = "destText"
for i = 1 to Selection.rows.count
for j = 1 to Selection.columns.count
Selection.cells(i, j).value = replace (Selection.cells(i, j).value, txt , replaceAs)
next j
next i
End Sub

1 Comments
sasi, 21 - days ago  

This macro cannot be applicable for format related replacement.
For example Currency format changes, '$' symbol was replaced by 'USD'.
It was possible by using " Selection.cells(i, j).Text " tag.




 RSS of this page

Written by:   Written by:   Version:   Last Edited By:   Modified