urgent! need to find "," in number
Hi I need to find out if a number cell in a cloumn contains "," and the fire
a msgbox i need to fire msgbox when i come across cell containg value 31,205 Usually, i would use instr or other string functions but being a number, thosse strigs are not working . Any help appreciated. |
urgent! need to find "," in number
Use the Text property of the range, not the Value property. E.g.,
Debug.Print InStr(Range("A1").Text, ",") -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "vbastarter" wrote in message ... Hi I need to find out if a number cell in a cloumn contains "," and the fire a msgbox i need to fire msgbox when i come across cell containg value 31,205 Usually, i would use instr or other string functions but being a number, thosse strigs are not working . Any help appreciated. |
urgent! need to find "," in number
I'd wonder before starting this whether the ',' isn't actually in the format
and not the value of the cell. If it's in the actual cell data then it will be a string search Excel may display 31,205, but it will actually be storing 31025 so looking for the ',' will not work. Check this out by highlighting the cell and looking at the value stored in the formula bar -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk "vbastarter" wrote in message ... Hi I need to find out if a number cell in a cloumn contains "," and the fire a msgbox i need to fire msgbox when i come across cell containg value 31,205 Usually, i would use instr or other string functions but being a number, thosse strigs are not working . Any help appreciated. |
urgent! need to find "," in number
Hi I need to find out if a number cell in a cloumn contains "," ...
i need to fire msgbox when i come across cell containg value 31,205 ...string functions ... are not working . Can you test for the number being 999 and the cell formatting's NumberFormat containing ","? Gregg Roberts |
urgent! need to find "," in number
try using
range("A1").numberfornat like "*,*" "Nick Hodge" wrote in message ... I'd wonder before starting this whether the ',' isn't actually in the format and not the value of the cell. If it's in the actual cell data then it will be a string search Excel may display 31,205, but it will actually be storing 31025 so looking for the ',' will not work. Check this out by highlighting the cell and looking at the value stored in the formula bar -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk "vbastarter" wrote in message ... Hi I need to find out if a number cell in a cloumn contains "," and the fire a msgbox i need to fire msgbox when i come across cell containg value 31,205 Usually, i would use instr or other string functions but being a number, thosse strigs are not working . Any help appreciated. |
All times are GMT +1. The time now is 03:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com