Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8733607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:40:58+00:00 2026-06-13T09:40:58+00:00

Rewording my question: Sub Path() Dim path As Range Dim shPivot As Worksheet Set

  • 0

Rewording my question:

Sub Path()
Dim path As Range
Dim shPivot As Worksheet
Set shPivot = ActiveWorkbook.Sheets("Pivot")
Set path = shPivot.Range("E12").Value
Set wkbFrom = Workbooks.Open("S:\_Supply Chain\Weekly Rpts Supplier and Buyer\" & path & "\SUPPLIER_01_00028257_KIK CUSTOM PRODUCTS GAINSVILLE_21-OCT-12.xls")

Path is a date in a cell. When this cell changes, I want the directory to change according to path.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:40:59+00:00Added an answer on June 13, 2026 at 9:40 am

    Two Things

    1. Declare path as string and not as range.
    2. Replace “\” in the date before using it in the path

    Is this what you are trying?

    Dim path As String
    path = shPivot.Range("E12").Value
    Set wkbFrom = Workbooks.Open("S:\_Supply Chain\Weekly Rpts Supplier and Buyer\" & _
                  format(path,"DD-MM-YYYY") & _
                  "\SUPPLIER_01_00028257_KIK CUSTOM PRODUCTS GAINSVILLE_21-OCT-12.xls")
    

    FOLLOWUP

    In that case use this

    Dim path As String
    path = shPivot.Range("E12").Value
    Set wkbFrom = Workbooks.Open("S:\_Supply Chain\Weekly Rpts Supplier and Buyer\" & _
                  path & _
                  "\SUPPLIER_01_00028257_KIK CUSTOM PRODUCTS GAINSVILLE_21-OCT-12.xls")
    

    If there are any unwanted spaces then you will have to use TRIM

    Dim path As String
    path = shPivot.Range("E12").Value
    Set wkbFrom = Workbooks.Open("S:\_Supply Chain\Weekly Rpts Supplier and Buyer\" & _
                  Trim(path) & _
                  "\SUPPLIER_01_00028257_KIK CUSTOM PRODUCTS GAINSVILLE_21-OCT-12.xls")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

simple question regarding property value inheritance in UserControls. If i create a UserControl, it
C++ being a value oriented language doesn't seem to support OO (and thus sub-typing
I asked this question earlier, but it got a negative vote, so I'm rewording
I'm rewording this question since I understand a bit more now. Originally, what I
This Question is regarding crystal reports sub-report grouping I have around 10 sub-reports each
I've got a question regarding sub forms. Currently I've got 2 sub forms and
I'm rewording my question so hopefully I can get a better response. I asked
I've looked at a lot of questions on SO and google regarding sub-class mappings
Regarding the question on SO How to overload the calling process of any function
Quick question regarding memory management in C++ If I do the following operation: pointer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.