Get cell value
It is usually helpful to tell us exactly what error message you are getting
and which line it is occurring on. With that said, I think your problem is
in the Debug.Print statement, namely, the variable "x" is already a range,
so you don't have to encase it in a call to Range. Try that line like
this...
Debug.Print "The value is " & x.Text
--
Rick (MVP - Excel)
"Jason" wrote in message
...
Hello
I'm trying to get the cell value, if the cell has a value over a certain
range, but when I run this, I keep getting a run time error. Any ideas?
Can I not use the range funtion like this?
Sub CellValue()
Dim x
For Each x In Range("c1:c100")
If Not IsEmpty(x) Then
Debug.Print "The value is " & Range(x).Text
End If
Next x
End Sub
|