Find and Replace Advanced
Advanced find and replace with multiple criteria and formatting options
610 views
Perfect For:
- Bulk text replacement
- Format standardisation
- Data correction
VBA Code
Sub AdvancedFindReplace()
Dim ws As Worksheet
Dim findText As String, replaceText As String
Dim replaceCount As Long
Set ws = ActiveSheet
findText = InputBox("Enter text to find:")
If findText = "" Then Exit Sub
replaceText = InputBox("Enter replacement text:")
' Perform find and replace with options
With ws.UsedRange
replaceCount = 0
For Each cell In .Cells
If InStr(cell.Value, findText) > 0 Then
cell.Value = Replace(cell.Value, findText, replaceText)
replaceCount = replaceCount + 1
End If
Next cell
End With
MsgBox "Replaced " & replaceCount & " occurrences of \"" & findText & "\""
End Sub
Related Topics
find
replace
text
formatting
Need Custom VBA Solutions?
Our AI-powered VBA generator can create custom code tailored to your specific requirements in seconds.
Free AI generations every month — top up with credit packs anytime
Related Templates
More VBA templates in the same category
Intermediate
CSV Import with Data Types
Import CSV files with automatic data type detection and formatting
View Template
Beginner
Data Processing & Cleanup
Remove duplicates, clean data formats, and standardise entries
View Template
Intermediate
Timesheet & Attendance Tracker
Track employee working hours, overtime, absences, and holidays with automatic calculations, weekl...
View Template