Results 1 to 6 of 6

Adding Indian Rupee Symbol to an existing VBA code.

Threaded View

CosmicOne Adding Indian Rupee Symbol to... 03-16-2025, 09:56 AM
TMS Re: Adding Indian Rupee... 03-16-2025, 10:33 AM
CosmicOne Re: Adding Indian Rupee... 03-16-2025, 11:18 AM
MSDols Re: Adding Indian Rupee... 03-25-2025, 04:42 PM
CosmicOne Re: Adding Indian Rupee... 03-25-2025, 06:42 PM
TMS Re: Adding Indian Rupee... 03-25-2025, 06:45 PM
  1. #1
    Registered User
    Join Date
    03-15-2025
    Location
    California
    MS-Off Ver
    Office 2013 Professional
    Posts
    4

    Adding Indian Rupee Symbol to an existing VBA code.

    I have the following code from member shg.

    Sub ApplyLakh()
    FondOLakh Selection
    End Sub

    Sub FondOLakh(r As Range)
    ' shg 2009-0607
    ' Applies Lakh/Crore formatting to numeric cells in r
    ' One 1
    ' Ten 10
    ' Hundred 100
    ' Thousand 1,000
    ' Lakh 1,00,000
    ' Crore 1,00,00,000
    ' Thousand Crore 1,000,00,00,000
    ' Lakh Crore 1,00,000,00,00,000

    Const dEps As Double = 0.001
    Const LN10 As Double = 2.30258509299405

    Static vFmt As Variant

    Dim cell As Range
    Dim i As Long
    Dim dLog As Double

    If IsEmpty(vFmt) Then
    vFmt = Array( _
    "0.00_);(0.00)", _
    "00.00_);(00.00)", _
    "000.00_);(000.00)", _
    "0\,000.00_);(0\,000.00)", _
    "00\,000.00_);(00\,000.00)", _
    "0\,00\,000.00_);(0\,00\,000.00)", _
    "00\,00\,000.00_);(00\,00\,000.00)", _
    "0\,00\,00\,000.00_);(0\,00\,00\,000.00)", _
    "00\,00\,00\,000.00_);(00\,00\,00\,000.00)", _
    "000\,00\,00\,000.00_);(000\,00\,00\,000.00)", _
    "0\,000\,00\,00\,000.00_);(0\,000\,00\,00\,000.00)", _
    "00\,000\,00\,00\,000.00_);(00\,000\,00\,00\,000.00)", _
    "#0\,00\,000\,00\,00\,000.00_);(#0\,00\,000\,00\,00\,000.00)")
    End If

    Application.EnableEvents = False

    For Each cell In Intersect(r, r.Parent.UsedRange)
    If IsNumeric(cell.Value) Then
    If cell.Value = 0# Then
    cell.NumberFormat = "-??_)"
    Else
    i = Int(Log(Abs(cell.Value + dEps)) / LN10)
    If i < 0 Then i = 0
    If i > UBound(vFmt) Then i = UBound(vFmt)
    cell.NumberFormat = vFmt(i)
    End If
    End If
    Next cell

    Application.EnableEvents = True
    End Sub
    This macro works perfectly and shows negative numbers in parentheses. How do I add an Indian rupee symbol to this code so that each item will appear with the rupee symbol?
    Last edited by CosmicOne; 03-25-2025 at 06:45 PM. Reason: To add "Solved" to the title

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. add rupee symbol in formula
    By sanjuss2 in forum Excel General
    Replies: 5
    Last Post: 03-30-2019, 03:33 AM
  2. [SOLVED] How to insert ₹ (Rupee symbol)
    By prabhubox@yahoo.com in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-18-2015, 08:12 AM
  3. Indian Rupee format for figure already entered in excel
    By srinivasan1965 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2015, 02:45 AM
  4. MS Excel Rupee Symbol Not Displaying as a different symbol
    By perpectuals in forum Excel General
    Replies: 1
    Last Post: 07-02-2015, 07:03 AM
  5. Replies: 2
    Last Post: 03-17-2011, 08:55 PM
  6. Currency symbol -Rupee
    By ran1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-25-2010, 10:12 AM
  7. [SOLVED] Comma separator for custom Currency (Indian Rupee)
    By Bald Eagle in forum Excel General
    Replies: 1
    Last Post: 01-15-2006, 02:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1