ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Converting doubles to text ot string (https://www.excelbanter.com/excel-programming/392829-converting-doubles-text-ot-string.html)

SupperDuck

Converting doubles to text ot string
 
Hello,

I am getting value from a cell with VBA.

dim a as double

A= cell(1,1).value

And this will be the caption of a label. But when i do this, there is an
error like;

"Type mismatch"

What i guessed is that the label caption must be a text so i must convert it
into string or text, right?

If yes, how? If no? what can i do?

thanks...

Tim

Converting doubles to text ot string
 
dim A as String
A= Cstr(cell(1,1).value)


Tim

"SupperDuck" wrote in message
...
Hello,

I am getting value from a cell with VBA.

dim a as double

A= cell(1,1).value

And this will be the caption of a label. But when i do this, there is an
error like;

"Type mismatch"

What i guessed is that the label caption must be a text so i must convert
it
into string or text, right?

If yes, how? If no? what can i do?

thanks...




Mike H

Converting doubles to text ot string
 
try this:-

Sub jugation()
Dim a As Double
a = Cells(1, 1).Value
b = CStr(a)
End Sub

Mike

"SupperDuck" wrote:

Hello,

I am getting value from a cell with VBA.

dim a as double

A= cell(1,1).value

And this will be the caption of a label. But when i do this, there is an
error like;

"Type mismatch"

What i guessed is that the label caption must be a text so i must convert it
into string or text, right?

If yes, how? If no? what can i do?

thanks...


SupperDuck

Converting doubles to text ot string
 
Thanks.

"Tim" wrote:

dim A as String
A= Cstr(cell(1,1).value)


Tim

"SupperDuck" wrote in message
...
Hello,

I am getting value from a cell with VBA.

dim a as double

A= cell(1,1).value

And this will be the caption of a label. But when i do this, there is an
error like;

"Type mismatch"

What i guessed is that the label caption must be a text so i must convert
it
into string or text, right?

If yes, how? If no? what can i do?

thanks...






All times are GMT +1. The time now is 08:49 AM.

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