LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Copying a Currency Format?

I am trying to write a macro to copy the format in the current cell and apply
it to all cells in the book that are currently formated as a currency. Any
idea of why the below is not working?

Sub CurrencyCopy()

Dim rng As Range
Dim format As String
format = ActiveCell.NumberFormat
Msg = "This will reformat all cells currently containing a currency
format. Are you sure you wish to proceed?"
Ans = MsgBox(Msg, vbYesNo)
If Ans = vbYes Then
Set rng = ActiveSheet.UsedRange
For Each cell In rng
If VarType(cell) = vbCurrency Then
ActiveCell.NumberFormat = format
End If
Next cell
End If

'
End Sub



Thanks for the help!
 
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
How to format cells in Excel 2007 (i.e. currency format)? DonR Excel Discussion (Misc queries) 2 May 25th 08 11:16 PM
format cells for currency 2450 and have it format to $24.50? Karen C Excel Worksheet Functions 0 October 13th 05 03:21 PM
why does currency format change to number format? Cassie Excel Discussion (Misc queries) 3 March 18th 05 06:57 PM
Conversion from currency value to currency text format Frank Kabel Excel Programming 1 August 18th 04 10:06 PM


All times are GMT +1. The time now is 12:29 AM.

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"