Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select Case by Sheetname Property-String vs Array | Excel Programming | |||
Get Property value of class instance by passing string property name | Excel Programming | |||
Checking if a property contains another specific string | Excel Programming | |||
Property Let: assign return value of Double when passing String | Excel Discussion (Misc queries) | |||
format text string for SeriesCollection.Name property | Excel Programming |