I'm not sure what you mean by "stupid hungarian notation", it just looks like crappy VBA to me. But then I haven't programmed VBA for over 10 years. So, I did this, and still no joy: vba code: Sub SearchNReplace1()
Dim sFindInitial As String
Dim sReplaceInitial As String
Dim iLenInitial As Integer
Dim sFindFinal As String
Dim sReplaceFinal As String
Dim iLenFinal As Integer
Dim sTemp As String
Dim rCell As Range
For Each rCell In Selection
sTemp = rCell.Value
iLenInitial = Len("=")
iLenFinal = Len("/7")
If Left(sTemp, iLenInitial) = "=" And Right(sTemp, iLenFinal) = "/7" Then
sTemp = Mid(sTemp, iLenInitial + 1)
sTemp = Left(sTemp, Len(sTemp) - iLenFinal)
sTemp = "=CEILING(" & sTemp & "/7,1)"
rCell.Value = sTemp
End If
Next
Set rCell = Nothing
End Sub
bastard by name bastard by nature |