Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Replacing "NULL"

Hello all,

I'm pasting data from SQL Server to Excel, so a lot of cells end up with "NULL" in them. I'm running the following statement to try
to clear the contents of these cells:

Selection.Replace "NULL", Null, xlPart, xlByRows, False, False, False

The problem I'm having is that it is a crap shoot as to whether the cell contents are actually cleared or just replaced with an
apostrophe (').

Any suggestions on how I can modify the statement above (or a different statement to use) that will actually clear the contents of
each of these cells?

Thanks for any help anyone can provide,

Conan Kelly


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Replacing "NULL"

Selection.Replace "NULL", "", xlPart, xlByRows, False, False, False


--
Regards,
Tom Ogilvy

"Conan Kelly" wrote:

Hello all,

I'm pasting data from SQL Server to Excel, so a lot of cells end up with "NULL" in them. I'm running the following statement to try
to clear the contents of these cells:

Selection.Replace "NULL", Null, xlPart, xlByRows, False, False, False

The problem I'm having is that it is a crap shoot as to whether the cell contents are actually cleared or just replaced with an
apostrophe (').

Any suggestions on how I can modify the statement above (or a different statement to use) that will actually clear the contents of
each of these cells?

Thanks for any help anyone can provide,

Conan Kelly



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Replacing "NULL"

Tom,

Thanks for all of your help.

If I remember correctly, I had the statement set up this way before I changed the "Replacement" argument to NULL and I had the same
results as what I'm getting now.

I will try it again just to be sure, but any other suggestions will be appreciated.

Thanks again,

Conan


"Tom Ogilvy" wrote in message ...
Selection.Replace "NULL", "", xlPart, xlByRows, False, False, False


--
Regards,
Tom Ogilvy

"Conan Kelly" wrote:

Hello all,

I'm pasting data from SQL Server to Excel, so a lot of cells end up with "NULL" in them. I'm running the following statement to
try
to clear the contents of these cells:

Selection.Replace "NULL", Null, xlPart, xlByRows, False, False, False

The problem I'm having is that it is a crap shoot as to whether the cell contents are actually cleared or just replaced with an
apostrophe (').

Any suggestions on how I can modify the statement above (or a different statement to use) that will actually clear the contents
of
each of these cells?

Thanks for any help anyone can provide,

Conan Kelly





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
Hyperion Essbase Excel Add-in - returning text ("0") for null valu bill_morgan Excel Discussion (Misc queries) 7 February 28th 12 05:10 AM
OTHER options for chart not plotting null ("") or zero values superdanz Charts and Charting in Excel 2 September 2nd 08 10:00 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
cells formatted to tick when text value "Y" if or null if "N" Jay Excel Discussion (Misc queries) 7 January 13th 06 09:16 AM
"IF"- "THEN" type Formula based on Null value Jay Excel Worksheet Functions 8 November 17th 05 09:05 AM


All times are GMT +1. The time now is 06:13 PM.

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"