Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Daisy Brown   on Aug 27 In MS Office Category.

  
Question Answered By: Joyce Edwards   on Aug 27

This works, replace  my "gggg" etc. with your variables. Tere are no
checks to see whether it finds something in the first column, when it
would have difficulty putting anything in the cell  to the left!:

Sub Blah()
Set c = Cells.Find(What:="gggg", LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False)
If Not c Is Nothing Then
Do
c.Replace What:="gggg", Replacement:="aaaa", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False
c.Offset(0, -1) = "6Descriptive text"
Set c = Cells.FindNext(c)
Loop While Not c Is Nothing
End If
End Sub

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 


Tagged: