![]() |
test first character in cell
can anyone please help with the vba to test the first character in a cell for
either "=" or "$"? THANKS |
test first character in cell
schr = left(cell.formula,1)
if schr = "=" or schr = "$" then Normally, a $ is produced by formatting and is not contained in the cell. In that case you would do sChr = left(cell.formula,1) sChr1 = left(cell.Text,1) if schr = "=" or schr1 = "$" then if you want to check if a cell contains a formula if cell.HasFormula then Also look at if vartype(cell) = vbCurrency then -- Regards, Tom Ogilvy "Newbie" wrote: can anyone please help with the vba to test the first character in a cell for either "=" or "$"? THANKS |
test first character in cell
Top man!! Thanks Tom.
"Tom Ogilvy" wrote: schr = left(cell.formula,1) if schr = "=" or schr = "$" then Normally, a $ is produced by formatting and is not contained in the cell. In that case you would do sChr = left(cell.formula,1) sChr1 = left(cell.Text,1) if schr = "=" or schr1 = "$" then if you want to check if a cell contains a formula if cell.HasFormula then Also look at if vartype(cell) = vbCurrency then -- Regards, Tom Ogilvy "Newbie" wrote: can anyone please help with the vba to test the first character in a cell for either "=" or "$"? THANKS |
All times are GMT +1. The time now is 01:06 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com