+ Reply to Thread
Results 1 to 2 of 2

Use Cell text as file name, via macro

  1. #1
    Registered User
    Join Date
    01-04-2005
    Posts
    2

    Question Use Cell text as file name, via macro

    I am trying to get a macro to pull a string from a cell in the ActiveSheet and use that string as the file name of the ActiveWorkbook. I have gotten the following to work in the macro, but want "Blank-proxy1.xls" to be the text pulled from cell A1 of the current worksheet.

    ActiveWorkbook.saveas Filename:="C:\Proxy\Blank-proxy1.xls", FileFormat:= _
    xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
    , CreateBackup:=False

    Thanks in advance!

    Mike

  2. #2
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    myBookName = Range("A1").Value
    ActiveWorkbook.saveas myBookName:= sFile & ".xls"

+ Reply to 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