[vba]If InStr(.Cells(i, "J"), "Mm") > 0 Then c.Formula = Replace(.Cells(i, "J"), "Mm", "MM")[/vba]
This a bastardized formula from other work I have- the c.Formula is the tricky part.
It errors on the c.Formula
This will run against the following list- there will be multiple occurrences of "Mm". This is a shortened list- there will be hundreds....
J2 = ;Waterproof Level: 10000Mm;Breathability Level: 5000Mm;Type: Shell;
J3 = ;Waterproof Level: 10000Mm;Breathability Level: 5000Mm;Type: Shell;
J4 = ;Waterproof Level: 20000Mm;Breathability Level: 5000Mm;Type: Insulated
[vba]
For Each wsSourceSheet In Workbooks("TGSProductsAttribPrep.xls").Worksheets
With wsSourceSheet
lrwSource = lr(wsSourceSheet, "A")
For i = 2 To lrwSource
If Not IsEmpty(.Cells(i, "G").Value) Then
.Cells(i, "J").Value = ";" & .Range("G1").Value & .Cells(i, "G").Value
End If
If Not IsEmpty(.Cells(i, "H").Value) Then
.Cells(i, "J").Value = .Cells(i, "J").Value & ";" & .Range("H1").Value & .Cells(i, "H").Value
End If
If Not IsEmpty(.Cells(i, "I").Value) Then
.Cells(i, "J").Value = .Cells(i, "J").Value & ";" & .Range("I1").Value & .Cells(i, "I").Value
End If
Dim c As Range
.Cells(i, "J").Value = Application.WorksheetFunction.Proper(.Cells(i, "J").Value)
If InStr(.Cells(i, "J"), "Mm") > 0 Then c.Formula = Replace(.Cells(i, "J"), "Mm", "MM")
(c.Value, " Crocodile ", "Print")
Next i
i = 2
wsSourceSheet.Columns("A:K").AutoFit
End With
Next wsSourceSheet
[/vba]