+ Reply to Thread
Results 1 to 6 of 6

Converting Currency Format

Hybrid View

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    69

    Converting Currency Format

    Hi there,

    I have a spreadsheet with a number of currencies that I want the format of a cell to change to given whatever currency I have inputted in another column.

    I actually found a code online that works really well if it was for 1 currency, but was wondering if someone could help change the code so that it would read for multiple currencies in different lines?
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Converting Currency Format

    Private Sub Worksheet_Change(ByVal Target As Range)
        If Intersect(Target, Me.Range("A2:A50")) Is Nothing Then Exit Sub
        On Error GoTo endit
        Application.EnableEvents = False
        With Target.Offset(, 1)
            Select Case Target.Value
            Case "USD"
                    .NumberFormat = "$#,##0.00"
                Case "GBP"
                    .NumberFormat = "£#,##0.00"
                Case "EUR"
                    .NumberFormat = "€#,##0.00"
                Case "AUD"
                    .NumberFormat = "$#,##0.00"
            End Select
        End With
    endit:
        Application.EnableEvents = True
    End Sub
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Converting Currency Format

    Maybe adjust that second line to dynamically target to last row:

    If Intersect(Target, Me.Range("A2", Me.Range("a" & Rows.Count).End(xlUp))) Is Nothing Then Exit Sub

  4. #4
    Registered User
    Join Date
    07-11-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Converting Currency Format

    Thanks so much for the quick response! this works perfectly! Actually is it possible to change the code so that we can manually run the macro instead of a change event?

    I tried switching to an Activate but then i'm getting an Object Required (Error 424) message.

    Thanks!

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Converting Currency Format

    Private Sub KittenExposion()
    Dim cell as Range
    For each cell in Range("A2:A50")
       Select Case cell.Value
            Case "USD"
                    Cell.Offset(,1).NumberFormat = "$#,##0.00"
                Case "GBP"
                    Cell.Offset(,1).NumberFormat = "£#,##0.00"
                Case "EUR"
                    Cell.Offset(,1).NumberFormat = "€#,##0.00"
                Case "AUD"
                    Cell.Offset(,1).NumberFormat = "$#,##0.00"
       End Select
    Next Cell
    End Sub

  6. #6
    Registered User
    Join Date
    07-11-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Converting Currency Format

    Thanks so much for your help!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Converting a value to a currency please help.
    By UKES in forum Excel General
    Replies: 14
    Last Post: 10-11-2013, 02:22 AM
  2. Converting currency to word
    By ck71 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-05-2013, 09:30 AM
  3. Replies: 2
    Last Post: 02-25-2013, 01:55 AM
  4. Converting currency
    By RWLAUS in forum Excel General
    Replies: 10
    Last Post: 12-14-2011, 11:16 PM
  5. Converting Text to Currency
    By madaboutgolf in forum Excel General
    Replies: 2
    Last Post: 10-28-2011, 02:26 AM
  6. Converting currency to a description
    By wmaughan in forum Excel General
    Replies: 1
    Last Post: 08-02-2006, 11:45 AM
  7. Converting Currency
    By SkyBluesFan in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-12-2005, 08:40 PM
  8. [SOLVED] Converting cell ref. w/num to currency
    By lulanosk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-26-2005, 05:05 AM

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