• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Cell Value as file name|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Cell Value as file name|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosCell Value as file name
sp_PrintTopic sp_TopicIcon
Cell Value as file name
Avatar
Jose Zavala
Member
Members
Level 0
Forum Posts: 41
Member Since:
October 25, 2017
sp_UserOfflineSmall Offline
1
November 5, 2021 - 12:56 am
sp_Permalink sp_Print

Hi,

False Then MsgBox "Save as " & save_name End If End Sub> 

have the code below how can I modify it that can use the value in cell A105 as the file name.

 

Code:

Sub Save_Workbook_NewName()

Dim fd As FileDialog

Set fd = Application.FileDialog(msoFileDialogFilePicker)
' Change initial folder as needed or store it in a cell and reference that
fd.InitialFileName = "\\mtlnas01\EFT_backup\2021\"
'fd.AllowMultiSelect = True
FilePicked = fd.Show

 ActiveSheet.Shapes("Button 13").Delete
 ActiveSheet.Shapes("Button 15").Delete
  ActiveSheet.Shapes("Button 17").Delete
  ActiveSheet.Shapes("Button 19").Delete
 ActiveSheet.Shapes("CommandButton1").Delete
 Worksheets("USD_WIRES").Range("A1").ClearComments
 Worksheets("USD_WIRES").Range("J1").ClearComments
 Worksheets("USD_WIRES").Range("K1").ClearComments
 
 
 save_name = Application.GetSaveAsFilename(fileFilter:="Excel File (*.xlsx), *.xlsx")
    ActiveWorkbook.SaveAs Filename:=save_name, FileFormat:=51
  [COLOR=rgb(184, 49, 47)][B]ThisWorkbook.SaveAs Range("A1"), 51    [/B][/COLOR]
    If save_name <> False Then
        MsgBox "Save as " & save_name
    End If


 End Sub

Thank you,
 
Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
November 6, 2021 - 2:52 pm
sp_Permalink sp_Print

Try:

save_name=Activesheet.Range("A105").Value

Make sure cell A105 has the extension as well, not just the complete file path, if not, add it:

save_name=Activesheet.Range("A105").Value & ".xlsx"

Avatar
Jose Zavala
Member
Members
Level 0
Forum Posts: 41
Member Since:
October 25, 2017
sp_UserOfflineSmall Offline
3
November 7, 2021 - 7:47 am
sp_Permalink sp_Print

Thank you, Catalin.

 

I'll test it and let you know.

Avatar
Jose Zavala
Member
Members
Level 0
Forum Posts: 41
Member Since:
October 25, 2017
sp_UserOfflineSmall Offline
4
November 19, 2021 - 2:29 pm
sp_Permalink sp_Print

Hi Catalin,

Question

 

I used your suggestions to save the file

 

save_name=Activesheet.Range("A105").Value but can't figure out how to put in cell a105 to put the complete file path in the formula.

 

Any suggestion.

 

Thank you

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
5
November 19, 2021 - 3:26 pm
sp_Permalink sp_Print

how to put in cell a105 to put the complete file path in the formula.

What formula you have in A105?

And where is the folder location?

Avatar
Jose Zavala
Member
Members
Level 0
Forum Posts: 41
Member Since:
October 25, 2017
sp_UserOfflineSmall Offline
6
November 20, 2021 - 2:09 am
sp_Permalink sp_Print

Hi,

 

is the information:

 

Formula placed on cell "A88":  =" "&O1&" "&A78&" NCL USD Wires Summary "&TEXT(A2,"MMMM DD, YYYY")&""

Formula results: 330 4 NCL USD Wires Summary November 18, 2021

Location: "\\mtlnas01\EFT_backup\2021\"

 

thank you,

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
7
November 20, 2021 - 6:26 am
sp_Permalink sp_Print sp_EditHistory

I don't understand the problem, looks like you know how to join pieces of text together.

Why not adding the location to your formula:

="\\mtlnas01\EFT_backup\2021\"&O1&" "&A78&" NCL USD Wires Summary "&TEXT(A2,"MMMM DD, YYYY")&".xlsx"

Avatar
Jose Zavala
Member
Members
Level 0
Forum Posts: 41
Member Since:
October 25, 2017
sp_UserOfflineSmall Offline
8
November 20, 2021 - 7:09 am
sp_Permalink sp_Print

thank you.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Chris Warren
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
michael serna
mashal sana
Tiffany Kang
Leah Gillmore
Sopi Yuniarti
LAFONSO HERNANDEZ
Hayden Hao
Angela chen
Sean Moore
John Chisholm
Forum Stats:
Groups: 3
Forums: 24
Topics: 6215
Posts: 27248

 

Member Stats:
Guest Posters: 49
Members: 31897
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.