Loading

Sunday, February 15, 2009

How To Replace Data Using Excel VBA Macro Code

In my case, I often manipulating data, including but not limited to searches all data in a worksheet and makes the specified replacement.

Here's an example how replace data using excel vba macro code. This example will replace all cell value that contain word "micro excel" to "macro excel" in active sheet.

Sub ReplaceAllData()

    Cells.Replace _
        What:="micro excel", Replacement:="macro excel", _
LookAt:=xlWhole, MatchCase:=False

End Sub

If you to make the search case sensitive you can change the MatchCase property to true. And also if you want to replace data that contain part of the searched data you can change the LookAt property to xlPart.



SHARE TWEET

Thank you for reading this article How To Replace Data Using Excel VBA Macro Code With URL https://x-tutorials.blogspot.com/2009/02/how-to-replace-data-using-excel-vba.html. Also a time to read the other articles.

0 comments:

Write your comment for this article How To Replace Data Using Excel VBA Macro Code above!