Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi.
I've programmed A BIT in VB before, but never with Excel. And i'm really having trouble with a stupid thing. To indicate a cell to excel... I only want him to read the value of a cell! A sort of: If Main!A5= "CLS" Then .... .... End If How to I write this "Main!A5" ?? Thank you. Marie |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Marie
If Sheets("Main").Range("A5") = "CLS" Then Regards Trevor "Marie Lavoie" wrote in message ... Hi. I've programmed A BIT in VB before, but never with Excel. And i'm really having trouble with a stupid thing. To indicate a cell to excel... I only want him to read the value of a cell! A sort of: If Main!A5= "CLS" Then ... ... End If How to I write this "Main!A5" ?? Thank you. Marie |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Marie,
'Sheets("Main").Range("A5")', properly speaking, is a Range object (the cell), not a String (the text the cell displays). Using 'Sheets("Main").Range("A5") = "CLS"' relies on VBAs "default value" of the Range object to return the String value of the cell. Allowing VBA to determine whether to return the cell or the text the cell displays can be unreliable under some not-very-rare circumstances. I recommend that you be unambiguous and use 'Sheets("Main").Range("A5").Text' which always returns the text the cell displays and never returns the cell. Bob Kilmer "Trevor Shuttleworth" wrote in message ... Marie If Sheets("Main").Range("A5") = "CLS" Then Regards Trevor "Marie Lavoie" wrote in message ... Hi. I've programmed A BIT in VB before, but never with Excel. And i'm really having trouble with a stupid thing. To indicate a cell to excel... I only want him to read the value of a cell! A sort of: If Main!A5= "CLS" Then ... ... End If How to I write this "Main!A5" ?? Thank you. Marie |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, Marie. Are you trying to read the value of the cell with Visual Basic,
or with an Excel VBA macro? Ed "Marie Lavoie" wrote in message ... Hi. I've programmed A BIT in VB before, but never with Excel. And i'm really having trouble with a stupid thing. To indicate a cell to excel... I only want him to read the value of a cell! A sort of: If Main!A5= "CLS" Then ... ... End If How to I write this "Main!A5" ?? Thank you. Marie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
Make it more simple or intuitive to do simple things | Charts and Charting in Excel | |||
simple question, hopefully a simple answer! | Excel Programming |