Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
fbm
 
Posts: n/a
Default Pence field to currency?

How do I convert a field in pence (12345) into currency so that it comes up
as £123.45? I know I could create a new field and divide by 100 but the
users will not be able to do that on their own from now on.

Thanks

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

With VBA.

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If .Column = 1 Then
.Value = .Value / 100
.NumberFormat = "£#,##0.00"
End If
End With

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.






--

HTH

RP
(remove nothere from the email address if mailing direct)


"fbm" wrote in message
...
How do I convert a field in pence (12345) into currency so that it comes

up
as £123.45? I know I could create a new field and divide by 100 but the
users will not be able to do that on their own from now on.

Thanks



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
Currency Style button Anita Excel Discussion (Misc queries) 3 April 18th 05 12:48 AM
Problems with Pivot Table Field Sorting in Excel 2002 Phoenix71555 Excel Discussion (Misc queries) 1 February 27th 05 11:25 PM
Pivot Tables..I give up... Debutante Excel Worksheet Functions 4 January 21st 05 10:43 PM
Is there a formula to spell out a number in excel? Sha-nay-nay Excel Worksheet Functions 2 December 18th 04 09:25 PM
Convert Numeric into Text Monty Excel Worksheet Functions 0 December 18th 04 09:25 PM


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