ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem getting cell value from range var (https://www.excelbanter.com/excel-programming/351151-problem-getting-cell-value-range-var.html)

John

Problem getting cell value from range var
 
I am running the following test macro code to display content of the first
cell in a verticle single column named range that contains about 20 items and
am getting a q=Error 2042 runtime 13 type mismatch error. How do I get the
first cell content correctly?

q = Range("jde_NewData")(1).Value
MsgBox "x=" & q

Tom Ogilvy

Problem getting cell value from range var
 
Sub efg()
Dim q As String
q = Range("jde_NewData")(1).Text
MsgBox "x=" & q

End Sub

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I am running the following test macro code to display content of the first
cell in a verticle single column named range that contains about 20 items

and
am getting a q=Error 2042 runtime 13 type mismatch error. How do I get the
first cell content correctly?

q = Range("jde_NewData")(1).Value
MsgBox "x=" & q





All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com