+ Reply to Thread
Results 1 to 2 of 2

Return Number in Currency format

Hybrid View

  1. #1
    Registered User
    Join Date
    08-25-2017
    Location
    USA
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    7

    Return Number in Currency format

    Hello,

    I have written a program to rename files using excel data: Title of Artwork - Price (Copies columns B & G)
    Is there a way I can return the price in currency format, i.e., return by thousands separator?


    Capture1.JPG

    'Copies/Renames files from column B & G. Need thousands format.
    Option Explicit
    Sub CopyRenameFilePrice()
    
        Dim src As String, dst As String, fl As String
        Dim rfl As String
        Dim lngMyRow As Long
        Dim lngLastRow As Long
    
        Application.ScreenUpdating = False
        
        lngLastRow = Range("A:E").Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).row + 1
        'Source directory
        src = "J:\My Art Work\UncategorizedArtWork\TitledArtWork"
        'Destination directory
        dst = "C:\Users\felizm\Desktop\temp"
        
        For lngMyRow = 2 To lngLastRow
            'File Name
            fl = Range("A" & lngMyRow)
            'Rename File
            rfl = Range("B" & lngMyRow) & " - " & "$" & Range("G" & lngMyRow) & ".00"
            On Error Resume Next
                FileCopy src & "\" & fl, dst & "\" & rfl & ".jpg"
            On Error GoTo 0
        Next lngMyRow
    
        Application.ScreenUpdating = True
        
        MsgBox "Done"
    
    End Sub
    Thank you very much.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Return Number in Currency format

    Maybe:
           rfl = Range("B" & lngMyRow) & " - " & Format(Range("G" & lngMyRow), "$#,##0.00")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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. [SOLVED] Select Currency format, get Number instead
    By JimDandy in forum Excel General
    Replies: 6
    Last Post: 07-30-2016, 12:45 AM
  2. [SOLVED] Currency with number in certain format
    By pansovic in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-08-2014, 12:17 AM
  3. Textbox to display a number or currency format
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2011, 11:00 PM
  4. Custom number format and currency converions
    By schult in forum Excel General
    Replies: 5
    Last Post: 05-06-2009, 12:03 PM
  5. [SOLVED] [SOLVED] Format number as currency in label control ?
    By Marc Gendron in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2006, 05:05 PM
  6. How do I format to currency when number includes cents?
    By INEEDHELP in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-13-2006, 11:36 AM
  7. [SOLVED] why does currency format change to number format?
    By Cassie in forum Excel General
    Replies: 3
    Last Post: 03-18-2005, 03:06 PM

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