+ Reply to Thread
Results 1 to 2 of 2

VBA Script using a cell reference in Save

  1. #1
    Forum Contributor
    Join Date
    12-14-2005
    Location
    US
    MS-Off Ver
    Excel 2019, Excel 365, Excel Mobile (Android)
    Posts
    144

    VBA Script using a cell reference in Save

    I have the following script that saves a report to a PDF file. The script saves the file name as referenced in the path below: F$ = .PathSeparator & "XXXX Worksheet Report .pdf". What i would like to do is have the referenced XXXX be a call reference. The cell is in a sheet (Dashboard) cell J12, which is a four digit number. Not sure how to do that as everything I have tried has not worked so far.

    Also, if I want to change the save location, which the script below saves to the desktop, how would that work. For example if I wanted to save it to a networked drive ("S:\Business\Fiscal\ACCOUNTING SECTION\XXXX Worksheet Report.pdf) how would I add that to the script.

    As always any help is greatly appreciated.

    Please Login or Register  to view this content.
    Last edited by Frick; 01-31-2023 at 10:23 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: VBA Script using a cell reference in Save

    As below. Cannot test in absence of file, so let us know if this works in your file.
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Replies: 25
    Last Post: 09-26-2018, 01:04 PM
  2. [SOLVED] Fixing a cell reference in a formula during a macro VBA script
    By D.Lovell in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-27-2014, 07:20 PM
  3. Replies: 2
    Last Post: 04-10-2014, 07:06 AM
  4. Imbed cell reference within script
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2013, 08:52 PM
  5. Macro with cell reference as a name, but prompt for save location and save as csv
    By tomham in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-15-2012, 06:21 PM
  6. Formula/Script to change reference cell based on date?
    By rbtroj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2012, 11:56 AM
  7. Reference A2 cell in individual sheets Vba Script
    By tek9step in forum Excel General
    Replies: 2
    Last Post: 06-11-2009, 08:20 AM

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