PC Review


Reply
Thread Tools Rate Thread

Converting doubles to text ot string

 
 
=?Utf-8?B?U3VwcGVyRHVjaw==?=
Guest
Posts: n/a
 
      6th Jul 2007
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...
 
Reply With Quote
 
 
 
 
Tim
Guest
Posts: n/a
 
      6th Jul 2007
dim A as String
A= Cstr(cell(1,1).value)


Tim

"SupperDuck" <(E-Mail Removed)> wrote in message
news:AB74F1FE-D436-4FAD-B8B8-(E-Mail Removed)...
> 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...



 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      6th Jul 2007
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...

 
Reply With Quote
 
=?Utf-8?B?U3VwcGVyRHVjaw==?=
Guest
Posts: n/a
 
      6th Jul 2007
Thanks.

"Tim" wrote:

> dim A as String
> A= Cstr(cell(1,1).value)
>
>
> Tim
>
> "SupperDuck" <(E-Mail Removed)> wrote in message
> news:AB74F1FE-D436-4FAD-B8B8-(E-Mail Removed)...
> > 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...

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting text string to stream Andrus Microsoft C# .NET 13 23rd Feb 2009 12:43 AM
Converting a text word or text string to a number Tom Microsoft Excel Misc 6 2nd Jan 2009 08:23 PM
Converting Doubles to Strings nvx Microsoft C# .NET 3 28th Mar 2007 08:49 PM
Converting records into a text string =?Utf-8?B?RWxpIHRoZSBJY2VtYW4=?= Microsoft Access Queries 5 3rd May 2006 09:55 PM
Converting Date to Text String =?Utf-8?B?Sm9obiBDYWxkZXI=?= Microsoft Excel Discussion 3 8th Apr 2005 11:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:35 AM.