ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find/Replace Macro with format changes to the replacing number (https://www.excelbanter.com/excel-programming/365680-find-replace-macro-format-changes-replacing-number.html)

[email protected]

Find/Replace Macro with format changes to the replacing number
 
I'm writing a simple macro to find an replace a specified value #N/A
with the value 0 formated as number with no decimals.

Here is my macro:

Sub FindReplace()
'
' FindReplace Macro
' Macro recorded 6/28/2006 by rwf33989
'
' Keyboard Shortcut: Ctrl+q
'
Cells.Replace What:="#N/A", Replacement:="0", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

How do I change this to make the formatting change? The entire sheet
should be formatted as accounting, but in those instances where a #N/A
is found, I want that value to be replaced with a 0 formated as NUMBER
with no decimal places.

I appreciate any help!

FB



All times are GMT +1. The time now is 09:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com