Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have a sheet that I use to keep track of vacations. In it, if a cell has the entry of "Vac", I want the assumption it is for 8 hours in the cell below, so I have a formula like this: =IF(ISTEXT(L5),"8.0",""). It works OK. (The idea is that most of the time it will be 8 hours, users can change it if required). Problem is when I add all the Vac cells in VB code, it treates the entries in the IF cells as String so concatinates the numbers. I have the cell defined as numbers, the variable in code is defined as integer. If I change the '8.0' that the IF statement generates with 8, the macro works as advertised. Any help is appreciated...........Herb |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Herb,
You could change your formula: =IF(ISTEXT(L5),8.0,"") Or within VB change your string to a value. FRom the immediate window assuming that your original formula is in cell L4 ?val(range("L4")) John "Herb" wrote in message ... Hi, I have a sheet that I use to keep track of vacations. In it, if a cell has the entry of "Vac", I want the assumption it is for 8 hours in the cell below, so I have a formula like this: =IF(ISTEXT(L5),"8.0",""). It works OK. (The idea is that most of the time it will be 8 hours, users can change it if required). Problem is when I add all the Vac cells in VB code, it treates the entries in the IF cells as String so concatinates the numbers. I have the cell defined as numbers, the variable in code is defined as integer. If I change the '8.0' that the IF statement generates with 8, the macro works as advertised. Any help is appreciated...........Herb |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to convert number to text | Excel Worksheet Functions | |||
Convert text to number | Excel Discussion (Misc queries) | |||
Convert text number to number formate | Excel Discussion (Misc queries) | |||
convert text-format number to number in excel 2000%3f | Excel Discussion (Misc queries) | |||
not able to convert text, or graphic number to regular number in e | Excel Worksheet Functions |