ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   numbers to characters (https://www.excelbanter.com/excel-worksheet-functions/100754-numbers-characters.html)

George Applegate

numbers to characters
 
I have a spreadsheet that is externally linked to a query. In four
colums are phone number information - area code, number, fax area code
and fax number. When the data is imported, some of the fields are
zero. I can format the column that if it's zero to show blank by
using a custom edit code. But...the number is still there, and zero,
even if it doesn't display as such.

Of course I can also do a find/replace on the four columns, but I'd
like to figure out a way that when the data comes in it automatically
replaces any cells in these four columns that have a zero with blanks.
Like the cell contains no data at all.

Is there a way to accomplish this?

thanks,
ga
George Applegate


VBA Noob

numbers to characters
 

This simple VBA code should do it

Could make it a Event producre or just add a macro button. It assumes
data starts in "A1".


Sub Remove_zero()
'
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Replace What:="0", Replacement:=""
Range("A1").Select
End Sub

VBA Noob


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=563972



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

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