PC Review


Reply
Thread Tools Rate Thread

controlling the Range.Replace method.

 
 
=?Utf-8?B?VC1DYXNleQ==?=
Guest
Posts: n/a
 
      10th Aug 2007
Thanks in advance,

I have a problem when ttrying to use the range.replace method in excel. If I
have left the find/replace environment in "within" "Workbook" mode and run my
VBA code. The routine will update the entire workbook instead of the selected
range as I would expect.

Is ther a way in VBA to reset the "within" setting to "sheet" prior to
executing the Replace method?

Also, can anyone give a quick explination to Searchformat & ReplaceFormat
parameters to this function. I can only find examples where they are set to
false. And the Microsoft documentation is not very helpful.

--
Tom Casey
Project Supervisor
sanofi-aventis
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VC1DYXNleQ==?=
Guest
Posts: n/a
 
      10th Aug 2007
Sorry
Office 2003 Professional SP2
--
Tom Casey
Project Supervisor
sanofi-aventis


"T-Casey" wrote:

> Thanks in advance,
>
> I have a problem when ttrying to use the range.replace method in excel. If I
> have left the find/replace environment in "within" "Workbook" mode and run my
> VBA code. The routine will update the entire workbook instead of the selected
> range as I would expect.
>
> Is ther a way in VBA to reset the "within" setting to "sheet" prior to
> executing the Replace method?
>
> Also, can anyone give a quick explination to Searchformat & ReplaceFormat
> parameters to this function. I can only find examples where they are set to
> false. And the Microsoft documentation is not very helpful.
>
> --
> Tom Casey
> Project Supervisor
> sanofi-aventis

 
Reply With Quote
 
Tim Williams
Guest
Posts: n/a
 
      10th Aug 2007
Resetting the search scope:
http://groups.google.com/group/micro...6082458637e4e6

For the formattting options, recording a macro while searching using
formatting will give you a good idea of the syntax.

Eg:

Application.FindFormat.Clear
With Application.FindFormat.Interior
.ColorIndex = 6
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With


Tim


"T-Casey" <(E-Mail Removed)> wrote in message
news:C00F610E-806F-4382-86DC-(E-Mail Removed)...
> Thanks in advance,
>
> I have a problem when ttrying to use the range.replace method in excel. If
> I
> have left the find/replace environment in "within" "Workbook" mode and run
> my
> VBA code. The routine will update the entire workbook instead of the
> selected
> range as I would expect.
>
> Is ther a way in VBA to reset the "within" setting to "sheet" prior to
> executing the Replace method?
>
> Also, can anyone give a quick explination to Searchformat & ReplaceFormat
> parameters to this function. I can only find examples where they are set
> to
> false. And the Microsoft documentation is not very helpful.
>
> --
> Tom Casey
> Project Supervisor
> sanofi-aventis



 
Reply With Quote
 
=?Utf-8?B?VC1DYXNleQ==?=
Guest
Posts: n/a
 
      11th Aug 2007
Thank you Tim. I never payed attention to the formatting FIND options. I will
have to consider if these options will be helpful.

I really need an answer to the first part. It is a real problem for the
solution I am designing.

--
Tom Casey
Project Supervisor
sanofi-aventis


"Tim Williams" wrote:

> Resetting the search scope:
> http://groups.google.com/group/micro...6082458637e4e6
>
> For the formattting options, recording a macro while searching using
> formatting will give you a good idea of the syntax.
>
> Eg:
>
> Application.FindFormat.Clear
> With Application.FindFormat.Interior
> .ColorIndex = 6
> .Pattern = xlSolid
> .PatternColorIndex = xlAutomatic
> End With
>
>
> Tim
>
>
> "T-Casey" <(E-Mail Removed)> wrote in message
> news:C00F610E-806F-4382-86DC-(E-Mail Removed)...
> > Thanks in advance,
> >
> > I have a problem when ttrying to use the range.replace method in excel. If
> > I
> > have left the find/replace environment in "within" "Workbook" mode and run
> > my
> > VBA code. The routine will update the entire workbook instead of the
> > selected
> > range as I would expect.
> >
> > Is ther a way in VBA to reset the "within" setting to "sheet" prior to
> > executing the Replace method?
> >
> > Also, can anyone give a quick explination to Searchformat & ReplaceFormat
> > parameters to this function. I can only find examples where they are set
> > to
> > false. And the Microsoft documentation is not very helpful.
> >
> > --
> > Tom Casey
> > Project Supervisor
> > sanofi-aventis

>
>
>

 
Reply With Quote
 
Tim Williams
Guest
Posts: n/a
 
      11th Aug 2007

"T-Casey" <(E-Mail Removed)> wrote in message
news:80BBB118-77A2-43E8-B8C6-(E-Mail Removed)...
> Thank you Tim. I never payed attention to the formatting FIND options. I
> will
> have to consider if these options will be helpful.
>
> I really need an answer to the first part. It is a real problem for the
> solution I am designing.
>


Tom,

The solution in the link I included (from PeterT) didn't work for you ?
Here's the relvant part:

******************
I always reset it -

On Error Resume Next
Set r = Cells.Find(What:="", _
LookIn:=xlFormulas, _
SearchOrder:=xlRows, _
LookAt:=xlPart, _
MatchCase:=False)
On Error GoTo 0
******************


Tim


> --
> Tom Casey
> Project Supervisor
> sanofi-aventis
>
>
> "Tim Williams" wrote:
>
>> Resetting the search scope:
>> http://groups.google.com/group/micro...6082458637e4e6
>>
>> For the formattting options, recording a macro while searching using
>> formatting will give you a good idea of the syntax.
>>
>> Eg:
>>
>> Application.FindFormat.Clear
>> With Application.FindFormat.Interior
>> .ColorIndex = 6
>> .Pattern = xlSolid
>> .PatternColorIndex = xlAutomatic
>> End With
>>
>>
>> Tim
>>
>>
>> "T-Casey" <(E-Mail Removed)> wrote in message
>> news:C00F610E-806F-4382-86DC-(E-Mail Removed)...
>> > Thanks in advance,
>> >
>> > I have a problem when ttrying to use the range.replace method in excel.
>> > If
>> > I
>> > have left the find/replace environment in "within" "Workbook" mode and
>> > run
>> > my
>> > VBA code. The routine will update the entire workbook instead of the
>> > selected
>> > range as I would expect.
>> >
>> > Is ther a way in VBA to reset the "within" setting to "sheet" prior to
>> > executing the Replace method?
>> >
>> > Also, can anyone give a quick explination to Searchformat &
>> > ReplaceFormat
>> > parameters to this function. I can only find examples where they are
>> > set
>> > to
>> > false. And the Microsoft documentation is not very helpful.
>> >
>> > --
>> > Tom Casey
>> > Project Supervisor
>> > sanofi-aventis

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?VC1DYXNleQ==?=
Guest
Posts: n/a
 
      20th Aug 2007
sorry for the delay, but ...

Thank you Tim. This is the solution to my problem

--
Tom Casey
Project Supervisor
sanofi-aventis


"Tim Williams" wrote:

>
> "T-Casey" <(E-Mail Removed)> wrote in message
> news:80BBB118-77A2-43E8-B8C6-(E-Mail Removed)...
> > Thank you Tim. I never payed attention to the formatting FIND options. I
> > will
> > have to consider if these options will be helpful.
> >
> > I really need an answer to the first part. It is a real problem for the
> > solution I am designing.
> >

>
> Tom,
>
> The solution in the link I included (from PeterT) didn't work for you ?
> Here's the relvant part:
>
> ******************
> I always reset it -
>
> On Error Resume Next
> Set r = Cells.Find(What:="", _
> LookIn:=xlFormulas, _
> SearchOrder:=xlRows, _
> LookAt:=xlPart, _
> MatchCase:=False)
> On Error GoTo 0
> ******************
>
>
> Tim
>
>
> > --
> > Tom Casey
> > Project Supervisor
> > sanofi-aventis
> >
> >
> > "Tim Williams" wrote:
> >
> >> Resetting the search scope:
> >> http://groups.google.com/group/micro...6082458637e4e6
> >>
> >> For the formattting options, recording a macro while searching using
> >> formatting will give you a good idea of the syntax.
> >>
> >> Eg:
> >>
> >> Application.FindFormat.Clear
> >> With Application.FindFormat.Interior
> >> .ColorIndex = 6
> >> .Pattern = xlSolid
> >> .PatternColorIndex = xlAutomatic
> >> End With
> >>
> >>
> >> Tim
> >>
> >>
> >> "T-Casey" <(E-Mail Removed)> wrote in message
> >> news:C00F610E-806F-4382-86DC-(E-Mail Removed)...
> >> > Thanks in advance,
> >> >
> >> > I have a problem when ttrying to use the range.replace method in excel.
> >> > If
> >> > I
> >> > have left the find/replace environment in "within" "Workbook" mode and
> >> > run
> >> > my
> >> > VBA code. The routine will update the entire workbook instead of the
> >> > selected
> >> > range as I would expect.
> >> >
> >> > Is ther a way in VBA to reset the "within" setting to "sheet" prior to
> >> > executing the Replace method?
> >> >
> >> > Also, can anyone give a quick explination to Searchformat &
> >> > ReplaceFormat
> >> > parameters to this function. I can only find examples where they are
> >> > set
> >> > to
> >> > false. And the Microsoft documentation is not very helpful.
> >> >
> >> > --
> >> > Tom Casey
> >> > Project Supervisor
> >> > sanofi-aventis
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any method of controlling when Outlook and Gmailsynchronizes. R. audit2 Microsoft Outlook 4 10th Feb 2010 01:47 PM
Controlling a form generated by OpenTable or OpenView method Yarik Microsoft Access 2 23rd May 2008 02:27 AM
String.Replace method not usable when knowing index to replace Lonifasiko Microsoft C# .NET 10 17th Oct 2007 09:02 PM
Replace method - cannot find any data to replace =?Utf-8?B?TWlrZQ==?= Microsoft Excel Programming 5 6th Apr 2006 08:56 PM
Re: I need a Replace function that will replace a range of numbers. Trevor Shuttleworth Microsoft Excel Worksheet Functions 0 30th Aug 2004 11:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:03 AM.