LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default VBA Replace using wildcard?

I have a very long string (an HTML document).

I want to replace all instances of a substring for which I know the first
few characters and the end character, but the middle part of the substring
can vary in both length and additional characters.

For example, if I want to replace each of the following using the Replace
function and wildcards:
<td class="dkbluelt" with <td
<td valign="top" bgcolor=#99cbe5" align="left" with <td

I have built a for loop using Instr and Mid functions, but it takes a long
time to run.

Is there any way to use the replace function in VBA using wildcards? for
example:
Result = Replace(MyLongString, "<td*", "<td")

Thanks for any suggestions.


 
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
Use a wildcard within edit/replace BabyMc Excel Discussion (Misc queries) 4 December 10th 09 07:25 AM
Wildcard in the Replace function User 100 Excel Discussion (Misc queries) 2 November 25th 09 04:14 AM
Use of Wildcard characters with replace tonuab Excel Discussion (Misc queries) 2 November 6th 09 09:39 PM
Doing a replace with a wildcard charcter John Excel Discussion (Misc queries) 2 October 2nd 09 02:49 PM
replace using wildcard, or else Office 2003 lover Excel Discussion (Misc queries) 3 January 17th 09 05:52 AM


All times are GMT +1. The time now is 12:05 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"