Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default must be too simple

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default must be too simple

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default must be too simple

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default must be too simple

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM


All times are GMT +1. The time now is 11:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"