Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find and Replace error | Excel Discussion (Misc queries) | |||
Dissabling Error when editing formula with Find+Replace | Excel Worksheet Functions | |||
error messages | Excel Discussion (Misc queries) | |||
Find and replace error | Excel Worksheet Functions | |||
Pop-up Error Messages | Excel Programming |