PC Review


Reply
Thread Tools Rate Thread

concatenate text and formatted cell

 
 
Reddy
Guest
Posts: n/a
 
      11th Apr 2008
Hello
I'm trying to concatenate some text and the numeric value of a cell
formatted to 2 decimal places and enter the result in a cell -
VarPasteCell.
Using the following vba code in excel,

VarPasteCell.Value = "DP:£" & Cell.Offset(0, 5).Value

I get the result DP:£6.8 but am looking for DP:£6.80 as the number is
a price.

Is there a way to format the number in the same line of code? I've
tried using application.round(cell.offset(0,5).value, 2) and various
other custom formatting techniques but can't get it to work.

Please can you help?
Thanks in advance
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      11th Apr 2008
maybe

Range("VarPasteCell").Value = "DP:£" & Range("VarPasteCell").Offset(0, 5).Text

Mike

"Reddy" wrote:

> Hello
> I'm trying to concatenate some text and the numeric value of a cell
> formatted to 2 decimal places and enter the result in a cell -
> VarPasteCell.
> Using the following vba code in excel,
>
> VarPasteCell.Value = "DP:£" & Cell.Offset(0, 5).Value
>
> I get the result DP:£6.8 but am looking for DP:£6.80 as the number is
> a price.
>
> Is there a way to format the number in the same line of code? I've
> tried using application.round(cell.offset(0,5).value, 2) and various
> other custom formatting techniques but can't get it to work.
>
> Please can you help?
> Thanks in advance
>

 
Reply With Quote
 
Reddy
Guest
Posts: n/a
 
      11th Apr 2008
On Apr 11, 12:51*pm, Mike H <Mi...@discussions.microsoft.com> wrote:
> maybe
>
> Range("VarPasteCell").Value = "DP:£" & Range("VarPasteCell").Offset(0,5).Text
>
> Mike
>

Excellent!
Replacing .Value with .Text works a treat.
Thanks v much
R

 
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
linking a text formatted cell to a formula cell lacy Microsoft Excel Misc 2 22nd May 2009 03:19 PM
linking a text formatted cell to a formula cell lacy Microsoft Excel Misc 0 22nd May 2009 03:11 PM
Concatenate text cell and formula cell result GoinCrazy Microsoft Excel Worksheet Functions 4 26th Nov 2008 04:27 PM
Converting 'General' formatted cells to Text formatted cell using. =?Utf-8?B?WmFoaWQgS2hhbg==?= Microsoft Excel Worksheet Functions 1 12th Mar 2005 07:13 PM
Concatenate formatted date and text Ryan Microsoft Access 6 10th Apr 2004 04:35 PM


Features
 

Advertising
 

Newsgroups
 


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