Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Replacing data using the cell value not the formula


Hi all,

I'm trying to replace data in a cell range using the cell's valu
instead of it using the formula.

I'm using the following code:-

ActiveSheet.Range("I:I").Select
Selection.Replace What:="#N/A", Replacement:="0"
LookAt:=xlPart, LookIn:=xlValues, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False
_
ReplaceFormat:=False

However, when I run the macro it errors at this point.

Basically, I'm trying to remove the dreaded #N/A and replace it with
0. Is there an easier way of doing this??

Thanks

--
Hunter197
-----------------------------------------------------------------------
Hunter1978's Profile: http://www.excelforum.com/member.php...fo&userid=3726
View this thread: http://www.excelforum.com/showthread.php?threadid=56978

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Replacing data using the cell value not the formula

Why not include it in your formula:
=If(ISNA(<YourFormula),0,<YourFormula)

NickHK

"Hunter1978" wrote
in message ...

Hi all,

I'm trying to replace data in a cell range using the cell's value
instead of it using the formula.

I'm using the following code:-

ActiveSheet.Range("I:I").Select
Selection.Replace What:="#N/A", Replacement:="0",
LookAt:=xlPart, LookIn:=xlValues, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
ReplaceFormat:=False

However, when I run the macro it errors at this point.

Basically, I'm trying to remove the dreaded #N/A and replace it with a
0. Is there an easier way of doing this??

Thanks!


--
Hunter1978
------------------------------------------------------------------------
Hunter1978's Profile:

http://www.excelforum.com/member.php...o&userid=37261
View this thread: http://www.excelforum.com/showthread...hreadid=569786



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Replacing data using the cell value not the formula


Hi NickHK,

Thanks for your answer.

It seemd to have done the trick!

Many thanks

--
Hunter197
-----------------------------------------------------------------------
Hunter1978's Profile: http://www.excelforum.com/member.php...fo&userid=3726
View this thread: http://www.excelforum.com/showthread.php?threadid=56978

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
Replacing spaces with data from another cell Michael Excel Discussion (Misc queries) 2 December 16th 09 01:18 AM
Replacing spaces with data from another cell Michael Excel Worksheet Functions 1 December 16th 09 12:46 AM
Replacing cell referance with value in INDIRECT-formula HebbeLille Excel Worksheet Functions 6 July 30th 09 10:06 PM
Replacing data in a cell green72 Excel Discussion (Misc queries) 3 January 23rd 08 10:09 PM
Replacing Cell Data Mary Ann Excel Discussion (Misc queries) 1 October 3rd 06 07:46 PM


All times are GMT +1. The time now is 03:36 AM.

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"