Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default concatenate text and formatted cell

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default concatenate text and formatted cell

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default concatenate text and formatted cell

On Apr 11, 12:51*pm, Mike H 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I concatenate custom formatted numbers Sloth Excel Worksheet Functions 0 November 29th 06 03:34 PM
how do I concatenate custom formatted numbers RobynP Excel Worksheet Functions 0 November 29th 06 03:15 PM
concatenate formatted cells in excel Sandwiches2 Excel Programming 4 March 15th 06 12:31 AM
how do i concatenate conditionally formatted cells in excel Sandwiches2 Excel Worksheet Functions 0 March 14th 06 01:42 AM
Converting 'General' formatted cells to Text formatted cell using. Zahid Khan Excel Worksheet Functions 1 March 12th 05 07:13 PM


All times are GMT +1. The time now is 11:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"