+ Reply to Thread
Results 1 to 4 of 4

Entering current folder into a cell

  1. #1
    Registered User
    Join Date
    10-29-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Entering current folder into a cell

    Hi.

    I have been looking for a way to enter the folder where the excel file is located into a cell.
    I have seen you can add the whole path (=CELL("filename") ), however I am only wanting the 'last' folder it is in. For example:

    C:\docs\folder\data\Class D4\John Wayne\Profile.xlsx

    Would enter "John Wayne" into cell. The cell is namely the "name" cell.

    I work in a school and a teacher is wanting a couple of different excel files for each student (600 students) I am hoping that I can put the files in a folder with the students name as the folder. That way at least its only 600 names and not 600x7! The other details are similar on a lot of the files such as class (this is also one of the folders in the path).

    With thanks for any help.

  2. #2
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: Entering current folder into a cell

    Hi Nimril

    Welcome to the forum

    Does the attached do what you want? It uses VBA and will work on any file (Press Ctrl+shift+Q) so long as the Name Find file is open.

    To view the code, press Alt+F8 / Step into

    Regards
    Alastair
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-29-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Entering current folder into a cell

    Thank you Alastair.

    After trying several things I realised that every solution would use a Macro of some type. I left the post on since I was still curious on how to do it since I was going around in circles while trying.

    However since the macros are disabled by default on Excel throughout the school I realised that no mater how simple I made it would still mean people would encounter problems when tying to use it.

    I opted for a template that just fills the other details from the 1st worksheet, cutting down the amount they have to fill in, yet simple enough to not need any user interaction.

    Richard

  4. #4
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: Entering current folder into a cell

    Hi Richard

    If you could guarantee that (in your example) John Wayne would always be after the 5th backslash, you might be able to use a complicated "substitute" based formula?

    Regards
    Alastair

+ 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. [SOLVED] Use current cell and column as a range without entering it manually
    By dt_org in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-06-2013, 03:39 AM
  2. Entering current time in adjacent cell when entry is made
    By Ned the music guy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-24-2012, 04:17 AM
  3. Entering Current Time
    By cruzesr in forum Excel General
    Replies: 2
    Last Post: 08-21-2007, 04:55 AM
  4. [SOLVED] Any quick key for entering Current Date and Time?
    By Philip in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2006, 12:25 PM
  5. Entering current date and time
    By PrologPro in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-16-2005, 09:05 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