Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
can anyone please help with the vba to test the first character in a cell for
either "=" or "$"? THANKS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I test for the first character | Excel Programming | |||
How do I test for the first character | Excel Programming | |||
How do I test for the first character | Excel Programming | |||
How do I test for the first character | Excel Programming | |||
How do I test for the first character | Excel Programming |