Results 1 to 4 of 4

Thread: Display numbers in Lakhs

  1. #1
    Member
    Join Date
    Aug 2011
    Posts
    54
    Rep Power
    13

    Display numbers in Lakhs

    Hi,
    >>
    >> In Excel I needs to convert numbers in to indian format and the value
    >> should divided by lakhs and display in Lakhs.
    >>
    >> Example Rs.924104600.90 should reflect as Rs.9,241(in lakhs, Indian
    >> format)
    Pzl find the attached workbook where i needs all the numbers in lakhs using macro.

    Plz hlep.

    Prabhu
    Attached Files Attached Files

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi

    You mean like this..

    in J2 and copied down,

    ="Rs. "&ROUND(I2/100000,2)&" Lakhs"
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Member
    Join Date
    Aug 2011
    Posts
    54
    Rep Power
    13
    Hi,

    Yes, i want to devid all the numbers by(100000) but is there any way to use macro for all the numbers in the paget to convert in to lakhs.

    Plz find the attached sheet whare i want to convert all the numbers value in to lakhs.

    regerds,

    Prabhu
    Attached Files Attached Files

  4. #4
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi Prabhu,

    Create data validation in P1 which lists two words (Absolute, In Lakhs)

    This goes in the sheet module.

    Right click on tab name > View code and paste this code there.

    Code:
    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
        
        If Target.Address(0, 0) <> "P1" Then Exit Sub
        
        Dim rngNumbers      As Range
        Dim strAddr         As String
        
        Set rngNumbers = Intersect(Me.UsedRange, Range("D:I")).SpecialCells(2, 1) 'adjust the range
        strAddr = rngNumbers.Address(0, 0)
        
        Const ConversionNum As Long = 100000
        
        Select Case Target.Value
            Case "Absolute"
                rngNumbers = Evaluate("if(isnumber(" & strAddr & "),if(" & strAddr & "<>0," & strAddr & "*" & ConversionNum & "," & strAddr & ")," & strAddr & ")")
                rngNumbers.NumberFormat = """Rs. ""_(* #,##0.00_);""Rs. ""_(* (#,##0.00);_(* "" - ""??_);_(@_)"
            Case "In Lakhs"
                rngNumbers = Evaluate("if(isnumber(" & strAddr & "),if(" & strAddr & "<>0," & strAddr & "/" & ConversionNum & "," & strAddr & ")," & strAddr & ")")
                rngNumbers.NumberFormat = """Rs. ""_(* #,##0.00_)"" Lakhs"";""Rs. ""_(* (#,##0.00)"" Lakhs"";_(* ""-""??_);_(@_)"
        End Select
        
    End Sub
    Change the value in P1, the code will adjust the figures what you select in P1
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Change Display Range Based On Change of Dropdown Values
    By rich_cirillo in forum Excel Help
    Replies: 2
    Last Post: 03-29-2013, 04:58 AM
  2. Display sheet names in a message box
    By pells in forum Excel Help
    Replies: 4
    Last Post: 02-13-2013, 07:33 PM
  3. Formula to Display Month and Dates Using Spin Button
    By ayazgreat in forum Excel Help
    Replies: 6
    Last Post: 11-21-2012, 10:19 PM
  4. Replies: 4
    Last Post: 03-10-2012, 07:15 PM
  5. Display numbers in Lakhs
    By Prabhu in forum Excel Help
    Replies: 1
    Last Post: 01-29-2012, 02:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •