Closed Thread
Results 1 to 2 of 2

How to add the name of the file

  1. #1
    Registered User
    Join Date
    06-08-2007
    Posts
    39

    How to add the name of the file

    Hi, can someone please advise me on how to fix this macro, (the area marked in red). I want the name result from Cells(a,11) to be the file name then add the extension .xls

    Thanks
    Sam

    Sub JoinA2D()
    x = Sheets("QUOTES").Cells(Rows.Count, 2).End(xlUp).Row
    For a = 385 To x
    b = Cells(a, 4)
    Cells(a, 11) = Cells(a, 7) & "-" & Cells(a, 3) & "-" & "00" & Cells(a, 1) & "-" & Format(Cells(a, 5), "ddmmyy") & "-" & Cells(a, 6)
    Next a
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
    "Z:\Pumps_Division\CS&A Dept\Quotations Per Customer\" 'Cells(a, 11) & ".xls"

    ActiveCell.Offset(2, -3).Range("A1").Select

    End Sub

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to add the name of the file

    Please do not add a new thread to fix title..just edit your last thread by editing your post and click Go Advanced...then amend title....

    Also...

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

Closed Thread

Thread Information

Users Browsing this Thread

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

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