Currency formatting

andysh

Board Regular
Joined
Nov 8, 2019
Messages
111
Hi

I'm using the below to divide ranges but want the output to be in currency format (£), what do I need to add?

VBA Code:
LR = Cells(Rows.Count, 2).End(xlUp).Row

Range("N2:N" & LR) = Evaluate("M2:M" & LR & "/K2:K" & LR)
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Maybe something like the below

VBA Code:
Range("N2:N" & LR).value = Format(Evaluate("M2:M" & LR & "/K2:K" & LR),"$0.0")

You can always change the format
 
Upvote 0
Thanks for looking at this
However I'm getting "Run-time error '13': Type mismatch"
Any ideas?
 
Upvote 0
Managed to fix it with...

VBA Code:
Range("N2:N" & LR) = Evaluate("M2:M" & LR & "/K2:K" & LR)
Range("N2:N" & LR).NumberFormat = "£##,###.##"
 
Upvote 0
Managed to fix it with...

VBA Code:
Range("N2:N" & LR) = Evaluate("M2:M" & LR & "/K2:K" & LR)
Range("N2:N" & LR).NumberFormat = "£##,###.##"
it definitely would work with the Number format, but I felt It could work in one line, i tried in the immediate window and it worked but..............:biggrin:

I guess 'cos i tested with a single cell, but you have a range of cells
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,844
Members
449,471
Latest member
lachbee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top