Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Setting currency as string

Hi all

Is it possible to set a currency from a string?
Say I have "ABC" and want to use that as a currency?

I want to set it from VBA code

WBR
Sonnich
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,045
Default Setting currency as string

On Mon, 24 Oct 2011 10:32:29 -0700 (PDT), Sonnich Jensen wrote:

Hi all

Is it possible to set a currency from a string?
Say I have "ABC" and want to use that as a currency?

I want to set it from VBA code

WBR
Sonnich


Just use the same format you would use on the worksheet when setting the NumberFormat property. Depending on whether you want the currency at the start or end of the numbers, maybe something like: [$ABC] #,##0_);[Red][$ABC] (#,##0)



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Setting currency as string

On Oct 24, 9:17*pm, Ron Rosenfeld wrote:
On Mon, 24 Oct 2011 10:32:29 -0700 (PDT), Sonnich Jensen wrote:
Hi all


Is it possible to set a currency from a string?
Say I have "ABC" and want to use that as a currency?


I want to set it from VBA code


WBR
Sonnich


Just use the same format you would use on the worksheet when setting the NumberFormat property. *Depending on whether you want the currency at the start or end of the numbers, maybe something like: * *[$ABC] #,##0_);[Red][$ABC] (#,##0)


Or

sh2.Cells(j, 2).NumberFormat = "0.00\ [$" & sh1.Cells(i, iValuuta) &
"]"


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,045
Default Setting currency as string

On Tue, 25 Oct 2011 01:44:00 -0700 (PDT), Sonnich Jensen wrote:

Or

sh2.Cells(j, 2).NumberFormat = "0.00\ [$" & sh1.Cells(i, iValuuta) &
"]"


I cannot comment since I have no idea what is contained in sh1.Cells(i,iValuuta). I'll guess it contains "ABC" without the quotes.

I suspect, though, that the "\" is unneccessary. At least it would be unneccessary in the US version of Excel, but it doesn't hurt to have it there.
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Setting currency as string

On Oct 25, 12:54*pm, Ron Rosenfeld wrote:
On Tue, 25 Oct 2011 01:44:00 -0700 (PDT), Sonnich Jensen wrote:
Or


sh2.Cells(j, 2).NumberFormat = "0.00\ [$" & sh1.Cells(i, iValuuta) &
"]"


I cannot comment since I have no idea what is contained in sh1.Cells(i,iValuuta). *I'll guess it contains *"ABC" without the quotes.

I suspect, though, that the "\" is unneccessary. *At least it would be unneccessary in the US version of Excel, but it doesn't hurt to have it there.


SomeSheet.Cells(j, 2).NumberFormat = "0.00\ [$" & "ABC" & "]"




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,045
Default Setting currency as string

On Fri, 4 Nov 2011 08:54:12 -0700 (PDT), Sonnich Jensen wrote:

On Oct 25, 12:54*pm, Ron Rosenfeld wrote:
On Tue, 25 Oct 2011 01:44:00 -0700 (PDT), Sonnich Jensen wrote:
Or


sh2.Cells(j, 2).NumberFormat = "0.00\ [$" & sh1.Cells(i, iValuuta) &
"]"


I cannot comment since I have no idea what is contained in sh1.Cells(i,iValuuta). *I'll guess it contains *"ABC" without the quotes.

I suspect, though, that the "\" is unneccessary. *At least it would be unneccessary in the US version of Excel, but it doesn't hurt to have it there.


SomeSheet.Cells(j, 2).NumberFormat = "0.00\ [$" & "ABC" & "]"


Do you have a question? If so, please be explicit.
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 to add new currency Symbol in Format/Cell/Currency NOORZAD Excel Discussion (Misc queries) 2 June 22nd 09 07:59 AM
Setting a minimum currency value George Excel Worksheet Functions 3 August 4th 08 04:41 PM
Setting a string variable as the file name [email protected] Excel Discussion (Misc queries) 1 March 28th 07 11:10 PM
Need help setting the worksheet header/Footer margins based on string height? Doug Excel Discussion (Misc queries) 0 August 20th 06 02:05 AM
Setting character attributes in a text string Greg Neill Excel Worksheet Functions 1 June 15th 05 08:47 PM


All times are GMT +1. The time now is 08:51 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"