Comma Seperation issues: Numeric values are completely displayed differently

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
684
Hello
OMG
What i face now is
when values displayed in formula bar as 200600 it displays as 200,600 in cell instead of 2,00,600 ie incorrect comma placement
Following values
4,14,180 to display as 4,14,180 it displays as 4104,180
3,18,600 to display as 3,18,600 it dispalys as 3108,600
17676.40 displayed as 17,676 which is correct
400000 to display as 4,00,000 it dispalys as 40,00,000
i really dont know how addtional 0 is coming
Code:
For Each nmbrFrmtCell In .Range("CI3:CI50")
   nmbrFrmtCell.NumberFormat = Trim(Replace(Format(String(Len(Int(nmbrFrmtCell.value)) - 1, "#"), " @@\\,@@\\,@@\\,@@\\,@@\\,@@\\,@@0"), " \,", "")) 
Next nmbrFrmtCell

Desired is to have correct placement of comma and exact Numeric Value
when Tens, Hundreds, Thousand, TenThousand, One Lac, Ten lacs so on

Thanks NimishK
 
Last edited:

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Sending herewith file attached

Request you to compare two columns C and D from row 176 onward till 427
D columns value are marked with yellow for you to see the difference

Pl check the yellow marked values in FormulaBar also. you will see the difference
after i executed the code in workbook_open
i;ve added " ' " for not executing the code
for you to see the difference

Let me know the correction
The Range is differing from post#1 and code in the file

https://www.dropbox.com/preview/NumberFormat3.xlsm?role=personal
 
Last edited:
Upvote 0
hope I understand it correctly, it should be like in green column?

Instalment Amount 1
Instalment Amount 1
Result
88500​
88,500​
88,500​
37760​
37,760​
37,760​
28320​
28,320​
28,320​
33040​
33,040​
33,040​
843604​
8403,604​
843,604​
28320​
28,320​
28,320​
35400​
35,400​
35,400​
200000​
2000,000​
200,000​
200000​
2000,000​
200,000​
26904​
26,904​
26,904​
100000​
1000,000​
100,000​
70800​
70,800​
70,800​
30000​
30,000​
30,000​
250000​
2500,000​
250,000​
106200​
1006,200​
106,200​
40120​
40,120​
40,120​
220188​
2200,188​
220,188​
42480​
42,480​
42,480​
33040​
33,040​
33,040​
70800​
70,800​
70,800​
589941​
5809,941​
589,941​

custom format: _-* #,##0_ -;-* #,##0_ -;_-* "-"_-;_-@_-
or simply : Accounting with 0 decimal places
 
Last edited:
Upvote 0
Yes, you have understood perfectly. it should be like Green column

i used the custom format from worksheet as per your suggestion. Nothing worked
then
Code:
With ws

[I]'For Each nmbrFrmtCell In .Range("D3:D427")
'   nmbrFrmtCell.NumberFormat = Trim(Replace(Format(String(Len(Int(nmbrFrmtCell.Value)) - 1, "#"), " @@\\,@@\\,@@\\,@@\\,@@\\,@@\\,@@0"), " \,", "")) & ".00"
'Next
[/I].Columns("E").NumberFormat = "_-* #,#[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=0_"]#0_[/URL]  -;-* #,#[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=0_"]#0_[/URL]  -;_-*" & "-" & "_-;_-@_-"
End With
Still did not work. Also i closed the file and re-opened then also nothing worked.
I don't know whats happening. Using Excel2013
 
Last edited:
Upvote 0
Maybe try reset column format to General first then use custom format but I'm far far away from vba so I can't help
 
Upvote 0
the column was reset to General Format - Saved it Re-opened it. also incorporated the custom format and removed the VBA code
Sorry did not work.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,492
Members
448,967
Latest member
visheshkotha

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