Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find and Replace with VBA and Error messages

I have now for year an Access application which generates Excel worksheets and files al kind of data from a table into the excel sheet.
The templates of the Excel sheets can contain field names surrounded by « and» ie The text «Name» will be replace by the column Name value.
This works fine with Excel 97 and Excel 2000
But with Execel 2003 I get warning messages that it can't find the data, which is correct, because not every Excel sheet contains all the fields in a table.
How can I switch of these messages.

The code in Access to change the data ais as follows:

For i = 1 To MyWorkBook.Sheets.Count
Set MyWorkSheet = MyWorkBook.Sheets(i)
If MyWorkSheet.ProtectContents = False Then
MyWorkSheet.Cells.Replace _
What:=sFind, _
Replacement:=sReplace, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
Next i


Reply
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 and Replace error Emece Excel Discussion (Misc queries) 3 May 30th 10 08:57 PM
Dissabling Error when editing formula with Find+Replace ATChurch Excel Worksheet Functions 2 July 16th 09 02:07 PM
error messages bf Excel Discussion (Misc queries) 2 April 12th 06 03:15 AM
Find and replace error meesh1224 Excel Worksheet Functions 1 February 2nd 05 02:52 AM
Pop-up Error Messages rbaxter[_4_] Excel Programming 3 January 13th 04 10:16 AM


All times are GMT +1. The time now is 08:55 PM.

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

About Us

"It's about Microsoft Excel"