+ Reply to Thread
Results 1 to 18 of 18

cell value-file name

  1. #1
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    cell value-file name

    Hi,
    I want a certain cell to get the name of the Excel file, and is it possible for it to get only part of the name of the file?
    possible?
    Last edited by oriazria; 12-15-2020 at 08:03 AM.

  2. #2
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: cell value-file name

    =CELL("filename",A1) will give you the full filename and sheet name.

    Then you can use LEFT/RIGHT/MID/LEN to extract the bits you want.

  3. #3
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name

    Quote Originally Posted by Croweater View Post
    =CELL("filename",A1) will give you the full filename and sheet name.

    Then you can use LEFT/RIGHT/MID/LEN to extract the bits you want.
    HI, THANKS BUT IS DOSENT WORK
    what i need to write? and how i select only part of file name
    thanks

  4. #4
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: cell value-file name

    It depends on what part of the filename you want to select! What do you think i am...a mind reader?

  5. #5
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name


    Please Login or Register  to view this content.
    in this
    my file name is - ori azaria -test
    i want the cell c3 will "ori azria"
    thanks!

  6. #6
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name

    someone know maybe?

  7. #7
    Registered User
    Join Date
    12-02-2020
    Location
    London
    MS-Off Ver
    Microsoft 365
    Posts
    6

    Re: cell value-file name

    Hi,

    I think you want something like this. This will give you .xlsx at the end if its a xlsx file so if you want to remove that change the -1 to -6 as you would be removing 5 extra characters.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name

    Quote Originally Posted by LearningSlow View Post
    Hi,

    I think you want something like this. This will give you .xlsx at the end if its a xlsx file so if you want to remove that change the -1 to -6 as you would be removing 5 extra characters.

    Please Login or Register  to view this content.
    thank you friend but i didnt know why is dosent work to me:/
    can you write for me include my code?
    Please Login or Register  to view this content.
    thank you.

  9. #9
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name

    anyone know?:/

  10. #10
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name

    all this forum and anyone know how to do this?

  11. #11
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: cell value-file name

    Oh...there would be PLENTY of people that know how to do this. The question you need to ask yourself is "Why has no-one responded?"

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,356

    Re: cell value-file name

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  13. #13
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name

    Quote Originally Posted by bakerman2 View Post
    Please Login or Register  to view this content.
    thanks! how can i remove some characters from file name copy?

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,356

    Re: cell value-file name

    Something like this.

    Please Login or Register  to view this content.
    The only problem is how to tell the code how many characters to remove? It is now set to 5 but will this always be the same?

  15. #15
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name

    Quote Originally Posted by bakerman2 View Post
    Something like this.

    Please Login or Register  to view this content.
    The only problem is how to tell the code how many characters to remove? It is now set to 5 but will this always be the same?
    good!thanks
    I need the name to be in the cell in the extra sheet I have
    How do I define it?

  16. #16
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name

    Quote Originally Posted by oriazria View Post
    good!thanks
    I need the name to be in the cell in the extra sheet I have
    How do I define it?
    this is my code and it dosent work
    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    09-21-2020
    Location
    israel
    MS-Off Ver
    2017
    Posts
    113

    Re: cell value-file name

    I succeeded!
    thanks

  18. #18
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,356

    Re: cell value-file name

    You're welcome.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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] Importing a text file by vba referring to a cell for file name & file path
    By Vivek2705 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 12-01-2017, 08:54 AM
  2. [SOLVED] Loop through files in folder, email file to listed recipient of file name = cell value
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2017, 03:41 PM
  3. [SOLVED] Compare cell in one file to same cell in another file, continue macro only if cells match
    By CherylC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2014, 09:31 PM
  4. TXT Files + Cell Content => TXT File (1 new file for each cell)
    By nini86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2013, 01:07 PM
  5. Open 2nd file(CSV) from cell reference, copy columns to main file & close 2nd file
    By Langchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 05:09 AM
  6. Replies: 1
    Last Post: 07-14-2007, 07:25 AM
  7. Copying of cell text from one file to paste as cell comments in a 2nd file
    By Wayne in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2005, 02:06 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