Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find and Replace Question
I'm using Visual Studio 2005 rather than VBA to write this program. I needed
to find and replace all "#N/A" with "". If there are no "#N/A" s in the worksheet I get a message box from excel saying there was no data to replace... what code would i need to close this message box without having to do it manually? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find and Replace Question
I don't use Visual Studio, but in VBA you could eliminate the messagebox:
On Error Resume Next ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas, 16).Select For Each c In Selection If c.Text = "#N/A" Then c.Value = "" Next c Or did you wnat to see the messagebox for a few seconds and then have it disappear automatically? - David NewToVB wrote: I'm using Visual Studio 2005 rather than VBA to write this program. I needed to find and replace all "#N/A" with "". If there are no "#N/A" s in the worksheet I get a message box from excel saying there was no data to replace... what code would i need to close this message box without having to do it manually? Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find and Replace Question
Well this is what I have in VS:
On Error Resume Next oApp.Range("A1:X16").Replace("#N/A", "", XlLookAt.xlPart, XlSearchOrder.xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False) oAppBk11.Save() oAppBk11.Close() oApp is the excel object and oAppBk11 is the workbook name.... it still gives me the message box, any ideas? "David Hilberg" wrote: I don't use Visual Studio, but in VBA you could eliminate the messagebox: On Error Resume Next ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas, 16).Select For Each c In Selection If c.Text = "#N/A" Then c.Value = "" Next c Or did you wnat to see the messagebox for a few seconds and then have it disappear automatically? - David NewToVB wrote: I'm using Visual Studio 2005 rather than VBA to write this program. I needed to find and replace all "#N/A" with "". If there are no "#N/A" s in the worksheet I get a message box from excel saying there was no data to replace... what code would i need to close this message box without having to do it manually? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
find a replace character question | Excel Discussion (Misc queries) | |||
Advanced Find and Replace Question | Excel Discussion (Misc queries) | |||
Find & replace question.....I believe | Excel Discussion (Misc queries) | |||
Find & Replace question | Excel Programming | |||
Find/Replace Question | Excel Discussion (Misc queries) |