LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find and replace within VBA

Hi,
Thanks for the ideas - I'm trying to understand them!! I'm not tha
expert at VBA programming at all, but I'm learning fast!!

I think the code you gave me may not work as I am writing commands fo
a communication interface that has a set type library.

An example of the code follows:


Dim RetVal ' Implicitly a Variant.
Dim form, oldtext, text, counter
Set RetVal = CreateObject("monitor.verbatim")


RetVal.DetailMonitor = 1

RetVal.RangeFrom = "1ST04"
RetVal.RangeTo = "1ST04"

RetVal.MonthNo = "1"

RetVal.Source = 3 ' Product

RetVal.SourceName = "Avandamet"


RetVal.PComment = 1
RetVal.MComment = 1 ' 1 = true
RetVal.NComment = 1
RetVal.OComment = 1


RetVal.Extract

After this is a section of code to do with formatting the data i
Excel, plus repetitions of similar code extracting slightly differen
data.

What I want to do is change the "1ST04" to "2ND04" etc, so this has t
be done in the VBA section rather than through a worksheet as yo
suggested.

The section on your website seems similar to what I want except
cannot get it to work. The line

If j 0 And Not .ProcOfLine(i, vbext_pk_Proc) = "test
Then _
.ReplaceLine i, Replace(.Lines(i, 1), strFind
strReplace, , , vbTextCompare)

brings up an error saying "expected variable or procedure, not project
at the Replace(.Lines(i, 1) section.

If I could get around this hurdle it just might work?!?!

Any thoughts would be greatfully received.

Kat

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find & Replace: find part cell, replace whole cell katy Excel Worksheet Functions 3 April 3rd 23 01:20 PM
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Find and replace results can the appearance of find be different? LLS at DPW Excel Discussion (Misc queries) 2 October 26th 09 11:16 PM
where to put results of find operation in find and replace functio DEP Excel Worksheet Functions 5 November 15th 06 07:52 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM


All times are GMT +1. The time now is 08:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"