Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Property of a cell with a string

If .Cells(myRow, myColumn).???? = "String"
Then

What property of cells do I need here? Value gives an error.
Auto List Members, List properties/Methods won't work for me. They are
turned on in Options but I can't get any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Property of a cell with a string

After serious thinking Slim Slender wrote :
If .Cells(myRow, myColumn).???? = "String"
Then

What property of cells do I need here? Value gives an error.
Auto List Members, List properties/Methods won't work for me. They are
turned on in Options but I can't get any help.


..Value is default; .Text may be an option; -neither are needed here!

Try using a var to put the cell contents into, then test the var.

Dim vTemp As Variant

'Get the cell contents
vTemp = Cells(myRow, myColumn)

'Test the cell contents
If vTemp = "String" Then...

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Property of a cell with a string


Try this with text in B5 and with a number in B5 Then run it with and without ".Value"
....
Don't place any bets ahead of time. <g
'---
Sub xyz()
Dim myType As String
myType = TypeName(Cells(5, 2).Value)

If myType = "String" Then
MsgBox myType
Else
MsgBox "Not a string, it is a " & myType
End If
End Sub
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Extras for Excel add-in: convenience built-in)





"Slim Slender"
wrote in message
...
If .Cells(myRow, myColumn).???? = "String"
Then

What property of cells do I need here? Value gives an error.
Auto List Members, List properties/Methods won't work for me. They are
turned on in Options but I can't get any help.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Property of a cell with a string

Thanks for the responses. Turned out all I had to do was specify the
column.

If .Cells(myRow, myColumn).Value = "String" Then doesn't
work, but

If .Cells(myRow, 5).Value = "String" Then works just
fine.

This is what I wanted in the first place but I was working with cloned
code
and hadn't completely adapted it.
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
Select Case by Sheetname Property-String vs Array owlnevada Excel Programming 12 August 25th 08 08:18 PM
Get Property value of class instance by passing string property name [email protected] Excel Programming 2 October 19th 07 05:47 PM
Checking if a property contains another specific string hugehead Excel Programming 1 September 13th 07 05:52 PM
Property Let: assign return value of Double when passing String Tetsuya Oguma Excel Discussion (Misc queries) 1 March 3rd 06 08:01 AM
format text string for SeriesCollection.Name property Rajdeep Excel Programming 0 March 4th 04 01:11 AM


All times are GMT +1. The time now is 09:57 PM.

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

About Us

"It's about Microsoft Excel"