Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hyperion Essbase Excel Add-in - returning text ("0") for null valu | Excel Discussion (Misc queries) | |||
OTHER options for chart not plotting null ("") or zero values | Charts and Charting in Excel | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
cells formatted to tick when text value "Y" if or null if "N" | Excel Discussion (Misc queries) | |||
"IF"- "THEN" type Formula based on Null value | Excel Worksheet Functions |