Excelcod,
Give this a try:
Sub ChangeOutgoingToVoicemailMacro_for_Excelcod()
Const TmDtCol As String = "A" 'The column containing the Time/Date stamps
Const TypeCol As String = "C" 'The column containing the Type
Const StartRow As Long = 2 'The row the data starts on (not the header row)
Dim rngTimes As Range: Set rngTimes = Range(TmDtCol & StartRow + 1, Cells(Rows.Count, TmDtCol).End(xlUp))
Dim TimeCell As Range, rngVM As Range
For Each TimeCell In rngTimes
If TimeCell.Value = TimeCell.Offset(-1, 0).Value Then
If rngVM Is Nothing Then
Set rngVM = Cells(TimeCell.Row, TypeCol)
Else
Set rngVM = Union(rngVM, Cells(TimeCell.Row, TypeCol))
End If
End If
Next TimeCell
If Not rngVM Is Nothing Then rngVM.Replace "outgoing", "voicemail"
End Sub
Hope that helps,
~tigeravatar
Bookmarks