Reputation: 41
I'm currently facing this struggle, i will try to explain it like this. The content of the cells: uml434, ffjdfuml434, uml32323. I want to change these cells to uml only. but in reallity there are alot more of these cells, and also ones that you dont want to change. is there a easy way to do this?
Thanks alot
Upvotes: 0
Views: 28
Reputation: 96753
Here is a small example that you can adapt to your needs. In this demo:
1.the data is in column A.
2.the values are constants, not formulas
Sub umlChanger()
Dim r As Range
Dim s As String
s = "uml"
For Each r In Columns(1).SpecialCells(2)
If InStr(r.Value, s) > 0 Then r.Value = s
Next r
End Sub
Macros are very easy to install and use:
If you save the workbook, the macro will be saved with it. If you are using a version of Excel later then 2003, you must save the file as .xlsm rather than .xlsx
To remove the macro:
To use the macro from Excel:
To learn more about macros in general, see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
and
http://msdn.microsoft.com/en-us/library/ee814735(v=office.14).aspx
Macros must be enabled for this to work!
Upvotes: 2