+ Reply to Thread
Results 1 to 7 of 7

RUN Time error,Rename PDF files using Excel Macro

Hybrid View

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

    Re: RUN Time error,Rename PDF files using Excel Macro

    Maybe:

    Sub Rename_All()
    
        Dim lastRow As Long, row As Long
        Dim path As String
        
        lastRow = Cells(Rows.Count, "A").End(xlUp).row
        For row = 1 To lastRow
            path = Left(Cells(row, "A").Value, InStrRev(Cells(row, "A").Value, "\"))
            Name path & Cells(row, "A").Value As path & Cells(row, "B").Value
        Next
        
    End Sub
    _________________
    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!)

  2. #2
    Registered User
    Join Date
    09-12-2012
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: RUN Time error,Rename PDF files using Excel Macro

    Dear JB

    Thanks for your input.
    But it shows error as "Run-Time error '5",Invalid proceducre call or argument

    Please Help.

    Thanks in Advance.


    Regards.
    Prasanna
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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