View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
David Hilberg David Hilberg is offline
external usenet poster
 
Posts: 84
Default 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!