gunny2k9
10-07-2010, 02:21 AM
I need a simple Find and Replace VBA code for excel. Dealing with a lot of text in Column H but need to search and replace a few words
Sub FindReplace()
Dim a As Long
For Each a In ActiveSheet.UsedRange
a = Replace(a, "Find", "Replace")
Next
End Sub
Found that code on google simple and works by searching all cells in all columns
but i need it to only search column H
so i tryed
Sub FindReplace()
Dim a As Long
For Each a In ActiveSheet.Range("H:H")
a = Replace(a, "Find", "Replace")
Next
End Sub
but seems to make now an endless loop ?
PLZ any help ?? sorry not very clued up on vba and been trying to sort this for a few days ..... just recording a macro of search and replace all falls over due to the amount of text in the cell (get a Formula to long Error)
the top code works but causes problems by searching all cells in all columns :(
Using Excel 2003
Sub FindReplace()
Dim a As Long
For Each a In ActiveSheet.UsedRange
a = Replace(a, "Find", "Replace")
Next
End Sub
Found that code on google simple and works by searching all cells in all columns
but i need it to only search column H
so i tryed
Sub FindReplace()
Dim a As Long
For Each a In ActiveSheet.Range("H:H")
a = Replace(a, "Find", "Replace")
Next
End Sub
but seems to make now an endless loop ?
PLZ any help ?? sorry not very clued up on vba and been trying to sort this for a few days ..... just recording a macro of search and replace all falls over due to the amount of text in the cell (get a Formula to long Error)
the top code works but causes problems by searching all cells in all columns :(
Using Excel 2003