Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default formatting variables

I have a macro that outputs the following line on an Excel spreadsheet:

2260.54 is the amount for your group.

The code is as follows:

activecell.offset (0,5) = vGrpAmt & " is the amount for your group"

I would like for it to display as follows:

$ 2,260.54 is the amount for your group.

I'm having trouble getting the dollar sign and commas to display in the
output. Any suggestions would be appreciated. Thanks for the help.........
--
JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default formatting variables



ActiveCell.Offset(0, 5) = Format(vGrpAmt, "$0,000.00") & " is the amount for
your group"

"JT" wrote:

I have a macro that outputs the following line on an Excel spreadsheet:

2260.54 is the amount for your group.

The code is as follows:

activecell.offset (0,5) = vGrpAmt & " is the amount for your group"

I would like for it to display as follows:

$ 2,260.54 is the amount for your group.

I'm having trouble getting the dollar sign and commas to display in the
output. Any suggestions would be appreciated. Thanks for the help.........
--
JT

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default formatting variables

One way:

ActiveCell.Offset(0, 5).Value = Format(vGrpAmt, _
"$ #,##0.00 ""is the amount for your group""")


In article ,
"JT" wrote:

I have a macro that outputs the following line on an Excel spreadsheet:

2260.54 is the amount for your group.

The code is as follows:

activecell.offset (0,5) = vGrpAmt & " is the amount for your group"

I would like for it to display as follows:

$ 2,260.54 is the amount for your group.

I'm having trouble getting the dollar sign and commas to display in the
output. Any suggestions would be appreciated. Thanks for the help.........

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default formatting variables

activecell.offset (0,5) _
= format(vGrpAmt, "$ #,###.00") & " is the amount for your group"

or something close to that.

JT wrote:

I have a macro that outputs the following line on an Excel spreadsheet:

2260.54 is the amount for your group.

The code is as follows:

activecell.offset (0,5) = vGrpAmt & " is the amount for your group"

I would like for it to display as follows:

$ 2,260.54 is the amount for your group.

I'm having trouble getting the dollar sign and commas to display in the
output. Any suggestions would be appreciated. Thanks for the help.........
--
JT


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default formatting variables

WS.Range("A2").Value = FormatCurrency(vGrpAmt) & " is the amount for your
group."

Changing WS.Range("A2").Value to whatever is your cell.

Bill Horton

"JT" wrote:

I have a macro that outputs the following line on an Excel spreadsheet:

2260.54 is the amount for your group.

The code is as follows:

activecell.offset (0,5) = vGrpAmt & " is the amount for your group"

I would like for it to display as follows:

$ 2,260.54 is the amount for your group.

I'm having trouble getting the dollar sign and commas to display in the
output. Any suggestions would be appreciated. Thanks for the help.........
--
JT



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
Conditional Formatting of Checklist with several date variables [email protected] Excel Worksheet Functions 0 September 17th 08 07:29 PM
Conditional formatting with variables ScoobyDoo Excel Worksheet Functions 1 February 22nd 08 06:00 PM
Conditional formatting for more than 3 variables Emile Excel Worksheet Functions 8 March 7th 06 04:27 PM
Number Formatting with string variables KempensBoerke Excel Programming 1 March 7th 04 03:45 AM
Cell formatting with 2 variables John Hipskind Excel Programming 6 August 4th 03 04:53 PM


All times are GMT +1. The time now is 11:31 PM.

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

About Us

"It's about Microsoft Excel"