Take folder name found in specific cell for VBA code

Nick70

Active Member
Joined
Aug 20, 2013
Messages
299
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a piece of code that refers to a specific folder in a directory.

The folder's name is that of the month it refers to and changes every month ( (e.g. October, November December etc.).

Rather than me changing the code each month with correct month name I wanted to point the code to a specific cell in active workbook (let's say cell B4 in Sheet1) that contained the month I would like to look at.
So instead of changing the name of the month in the code I would just type new month name in that specific cell (i.e. B4 in Sheet1).

Code below:

Code:
'   Set filepath
    fPathSrc = "P:\Lonib\Inter-department\Client Verification\06_Workflow Coordination\Reviewer's checklist\December\"           'Source file path


In example above the path points to month folder 'December'.
I would like to be able to change code so that the word December at the end of the path is taken from cell B4 in Sheet1 which I would type in manually.

How would I do that?

Thanks,
Nicola
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try this:
VBA Code:
'   Set filepath
    fPathSrc = "P:\Lonib\Inter-department\Client Verification\06_Workflow Coordination\Reviewer's checklist\" & Sheets("Sheet1").Range("B4") & "\"
 
Upvote 0
Solution

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top