+ Reply to Thread
Results 1 to 17 of 17

Generate a filename from cell's text content

Hybrid View

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    pou
    MS-Off Ver
    Excel 2003
    Posts
    15

    Generate a filename from cell's text content

    Hello!

    First of all, I'm new with Excel, so sorry if this is an impossible request.
    Can I have in column E a text generated from the A,B,C,D cells
    separated by "_" and a ".jpg" at the end?

    xcel.jpg
    Last edited by epouepou; 10-22-2013 at 11:31 AM.

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Generate a filename from cell's text content

    Try this:

    =A1&"_"&B1&"_"&C1&"_"&D1&".jpg"

    - Moo

  3. #3
    Registered User
    Join Date
    10-22-2013
    Location
    pou
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Generate a filename from cell's text content

    It's PERFECT!!!!!
    Thankyou so much man!!!! ^_^

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Generate a filename from cell's text content

    Glad to help =)

    - Moo

  5. #5
    Registered User
    Join Date
    10-22-2013
    Location
    pou
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Generate a filename from cell's text content

    In some raws, I have no data. So it writes the "__.jpg"

    Is there a way to modify the formula you already made so that:
    if those cells have no text, then it leaves empty the filename cell too.

  6. #6
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Generate a filename from cell's text content

    You can try:

    =IF(COUNTA(A1:D1)=0,"",A1&"_"&B1&"_"&C1&"_"&D1&".jpg")

    - Moo

  7. #7
    Registered User
    Join Date
    10-22-2013
    Location
    pou
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Generate a filename from cell's text content

    It's perfect, Moo!!!
    THANKYOU!!!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate a filename from cell's text content

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  9. #9
    Registered User
    Join Date
    10-22-2013
    Location
    pou
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Generate a filename from cell's text content

    last thing guys, sorry...

    Is it possible to have the filename not display also if there is a "/" in a particular column?
    In that case, if possible, to write to another column "cad."


    So in the attached xcel file it would be:
    If D has "/", empty J and write "cad." in G
    Attached Files Attached Files

  10. #10
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Generate a filename from cell's text content

    Put this in J3 and fill down:
    Formula: copy to clipboard
    =IF(OR(COUNTA(C3:F3)=0,D3="/"),"",C3&"_"&D3&"_"&E3&"_"&F3&".jpg")

    Then put this in G3 and fill down:
    Formula: copy to clipboard
    =IF(D3="/","cad.","")

    You can also change your formula in K3 to this and fill down:
    Formula: copy to clipboard
    =IF(I3="","",I3&".eps")
    - Moo
    Last edited by Moo the Dog; 10-23-2013 at 03:32 PM.

  11. #11
    Registered User
    Join Date
    10-22-2013
    Location
    pou
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Generate a filename from cell's text content

    I'm having problems with this, moo (maybe because I'm working on Google Spreadsheet)
    I also tried to put the formulas in NeoOffice Calc (I can't use Excel right now).

    I'm sure the formulas are correct, it seems there's an incompatibility between these programs.
    Is there a way to convert xcel fomulas to work on other like-software. Found nothing online..

    Anyway I'll keep the formulas and try to find a way to open the file in Excel.
    Thank you very much, for the time you put helping me Moo!!!

  12. #12
    Registered User
    Join Date
    10-22-2013
    Location
    pou
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Generate a filename from cell's text content

    in Excel the same problem: J and G not working.
    K is ok (thanks for correcting mine)

  13. #13
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Generate a filename from cell's text content

    See my attached file - they seem to work perfectly.

    - Moo
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    10-22-2013
    Location
    pou
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Generate a filename from cell's text content

    OK, I see the problem.. maybe I badly expose the question then. So excuse me for not being clear.

    if the "/" is in D even if there is other text in D, to leave empty the filename cell.

    G also gets "cad." if there's "/" (with or without other text) in D
    Last edited by epouepou; 10-24-2013 at 01:42 PM.

  15. #15
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Generate a filename from cell's text content

    OK, change the formulas to:

    G3:
    Formula: copy to clipboard
    =IF(ISNUMBER(FIND("/",D3)),"cad.","")

    J3:
    Formula: copy to clipboard
    =IF(OR(COUNTA(C3:F3)=0,ISNUMBER(FIND("/",D3))),"",C3&"_"&D3&"_"&E3&"_"&F3&".jpg")

    Then fill both down the columns. Should hopefully work how you want it to.

    - Moo

  16. #16
    Registered User
    Join Date
    10-22-2013
    Location
    pou
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Generate a filename from cell's text content

    IT'S IT!!!! XD
    THANK YOU SO MUCH!!!!
    Can't thank you enough Moo

  17. #17
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Generate a filename from cell's text content

    Glad to help

+ 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. Saving filename with content from a cell error
    By bryanc2k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2010, 06:52 AM
  2. Excel 2008 : Save as PDF with Cell content filename
    By Eboof in forum Excel General
    Replies: 0
    Last Post: 11-03-2010, 04:27 PM
  3. Saving filename with content from a cell?
    By fael097 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2010, 02:14 PM
  4. Replies: 6
    Last Post: 01-07-2009, 08:43 AM
  5. convert cell content to filename
    By [email protected] in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-01-2006, 03:10 PM

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