Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to use cell numerical values from a spreadsheet in a program i
V.B. Dim value1 As Integer Dim value2 As Integer Dim value3 As Integer value1 = CInt(Worksheets("sheet2").Range("B15")) value2 = CInt(Worksheets("sheet2").Range("B16")) value3 = CInt(Worksheets("sheet2").Range("B17")) If Abs(value1 - value2) <= 0.001 Then value3 = Rnd() * 0.007 I get a type mismatch error because i am trying to do a math operato with a worksheets("sheetx").Range("x") value which i think VB think these are srings and not intergers. Will CInt work for my purpose o no? Also is my syntax right for calling a cel (Worrksheets("sheet2").Range("B15"))? -Mar -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Type Mismatch Error | Excel Discussion (Misc queries) | |||
Help with Error: Type Mismatch | Excel Programming | |||
Type Mismatch Error | Excel Programming | |||
Type Mismatch Error Need Help | Excel Programming |