Hi

Replace that line with below two:

ff.Select
ActiveCell.replace What:=Search, Replacement:=Replacement, LookAt:=xlWhole,
_
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False


Cheers!!


On Mon, Feb 9, 2015 at 3:48 PM, Christos Alekopoulos <
christosalekopou...@gmail.com> wrote:

> Hi All,
>
> I have created this code that finds a value, then changes any pre-set
> value into a new value determined by the user as well. The problem is that
> I get an "error 424" and a message item required every time I run it. I
> have highlighted the line where it seems to have the error. The code is the
> following. Every idea and any help is really appreciated.
>
> Thank you
> Christos
>
> Sub replace()
> Dim WS As Worksheet
> Dim Search As String
> Dim Replacement As String
> Dim Prompt As String
> Dim Title As String
> Dim ID As String
> Dim mu As String
> Dim temp As Long
> Dim MatchCase As Boolean
> Prompt = "What is the risk ID?"
> Title = "Search Value Input"
> ID = InputBox(Prompt, Title)
> Prompt = "What is the original value you want to replace?"
> Title = "Search Value Input"
> Search = InputBox(Prompt, Title)
> Prompt = "What is the replacement value?"
> Title = "Search Value Input"
> Replacement = InputBox(Prompt, Title)
> For Each WS In Worksheets
>  Set r = WS.Cells.Find(myTask, , , 1)
>                 If Not r Is Nothing Then
>                     ff = r.Address
>                     'temp = r.EntireRow.Value
>                     ' r.EntireRow.Value
>                 temp = r.EntireRow.Value.Cells.replace(What:=Search,
> Replacement:=Replacement)
>                 End If
>  'mu = temp.Cells.replace(What:=Search, Replacement:=Replacement)
>  'temp = r.EntireRow.Value.Cells.replace(What:=Search,
> Replacement:=Replacement)
>
> Next
> 'temp.Cells.replace What:=Search, Replacement:=Replacement, _
> 'LookAt:=xlPart, MatchCase:=False
> 'mu = temp.Cells.replace(What:=Search, Replacement:=Replacement)
> End Sub
>
> --
> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
> https://www.facebook.com/discussexcel
>
> FORUM RULES
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>
> NOTE : Don't ever post confidential data in a workbook. Forum owners and
> members are not responsible for any loss.
> ---
> You received this message because you are subscribed to the Google Groups
> "MS EXCEL AND VBA MACROS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to excel-macros+unsubscr...@googlegroups.com.
> To post to this group, send email to excel-macros@googlegroups.com.
> Visit this group at http://groups.google.com/group/excel-macros.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to