+ Reply to Thread
Results 1 to 18 of 18

Convert Large Number of Cells into Seperate JPEGs

  1. #1
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Convert Large Number of Cells into Seperate JPEGs

    Hi guys.

    So, basically I am trying to find out if there is a way that I can go from Cell A1, down to say Cell A1000, and make a separate JPEG for each of the cell's contents. Is this possible? Presumably it would require some sort of VBA code or a macro, but I am not sure how to go about this, so I am just trying to find out if this is even feasible.

    If you are wondering why I want to do this, it is because I am trying to get a bunch of product names as seperate JPEGs that can then be put on a smart watch and swiped one by one.

    Thanks if you can help.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert Large Number of Cells into Seperate JPEGs

    Yes it can be done

    What is the NAME of each jpeg?
    - the text in each cell?
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Convert Large Number of Cells into Seperate JPEGs

    Yeah. I will make an example file and attach it. The attachment basically shows what I would like each cell (and thus JPEG) to look like (i.e. product name, and then quantity below it).
    As far as the file names go, if they are just the contents of the cell, then that's awesome. The minimum requirement is that the new file names preserve the order (i.e. which row was first, which second etc...).
    Hopefully that makes sense.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert Large Number of Cells into Seperate JPEGs

    Illegal characters in names
    Some characters like \ and / are not allowed in file names
    Hyphens are allowed

    Cannot use ZL50001A/01 100
    ... How about ZL50001A-01-100 ?


    Sequencing
    We see ZL50001A-01-1, ZL50001A-01-2, ZL50001A-01-12,ZL50001A-01-100

    But this is how text is sorted and how names are sequenced in folder lists etc
    ZL50001A-01-1
    ZL50001A-01-100
    ZL50001A-01-12
    ZL50001A-01-2

    VBA could alter the names to include leading zeros
    ZL50001A-01-001
    ZL50001A-01-002
    ZL50001A-01-012
    ZL50001A-01-100


    Let me have your thoughts
    Also consider the other segments - everything needs to be a consistent size to ensure sorting is as required
    ZL50001A-01-100
    Last edited by kev_; 09-04-2020 at 06:43 AM.

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert Large Number of Cells into Seperate JPEGs

    Is this how you want the image to look?
    Attached Images Attached Images

  6. #6
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Convert Large Number of Cells into Seperate JPEGs

    What you have suggest would be good enough. The last figure was in regard to the quantity, so actually the first option is fine, but it would probably just have different numbers like:

    ZL50001A-01-1
    ZL50001A-02-100
    ZL50001A-03-12
    ZL50001A-04-2

    As the first two parts are in reference to the product (the last is in reference to the qty). Oh, and the second part (i.e. after first hypen) will always be incrementing anyway (I think the absolute max would be 3 digits, but probably 2 in most cases) Would everything still need to be consistent size even with the extra clarification / info I have added?
    Last edited by Fugdkn; 09-04-2020 at 08:29 AM.

  7. #7
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Convert Large Number of Cells into Seperate JPEGs

    Quote Originally Posted by kev_ View Post
    Is this how you want the image to look?
    Yeah, Ideally.

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert Large Number of Cells into Seperate JPEGs

    thanks - will post some code when back at PC this evening

  9. #9
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Convert Large Number of Cells into Seperate JPEGs

    Thanks a bunch. Huge, Huge thanks.

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert Large Number of Cells into Seperate JPEGs

    Let's start by making sure that this function can deal without error with all your names
    The code requires that
    - variables A(/) & B(line break) are contained in the string
    - 2nd and 3rd elements are numeric
    Please test and let me know
    thanks

    Test on a copy of your data
    Place code in a module like module1 and then use like a normal Excel formula in cell
    =getname(A2)

    Please Login or Register  to view this content.

  11. #11
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert Large Number of Cells into Seperate JPEGs

    I have amended the function to prevent it failing if cell content causes an error
    - the cell image is saved with a created name so that it can be renamed manually
    - message box details any problem cells

    Test on a copy of your data
    Place code below in a new module and amend picPath string
    Run from sheet containing the values

    Please Login or Register  to view this content.
    Last edited by kev_; 09-05-2020 at 04:45 AM.

  12. #12
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Convert Large Number of Cells into Seperate JPEGs

    Hi. I just tried the second piece of code you sent and I got this popup:
    https://gyazo.com/90dcbb682b46a93352...de7f5d248c6ea7

    I will send the file over in case it's just me being a dumbass (I used CHAR(10) for the line break and then pasted as values).
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert Large Number of Cells into Seperate JPEGs

    Deleted by Kev
    Last edited by kev_; 09-05-2020 at 10:22 AM.

  14. #14
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert Large Number of Cells into Seperate JPEGs

    Oops
    Spotted it. I made a late change to Function name

    Change
    GetName To GetFileName (in 2 lines in the function)

  15. #15
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Convert Large Number of Cells into Seperate JPEGs

    That's awesome! (it worked now). Just a couple of things though. The image doesn't show the last term (i.e. the quantity: https://gyazo.com/777ff848d7ea376b7b...e89e1135c01691 ). Also the image is quite small. Is it possible for me to increase the size of the image, and if I change the ".jpg" in the code to ".png" will that make it higher quality or do I need to do something else if I want that? Thanks ever so much!

  16. #16
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Convert Large Number of Cells into Seperate JPEGs

    Ok, solved the issue of the quantity not showing up (just had to wrap the text in the cells properly). I guess now it's just about potentially finding a way to make a bigger + higher quality image if that's possible.

  17. #17
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Convert Large Number of Cells into Seperate JPEGs

    Ok, just figured out that all I need to do for that is to make the text in the cells larger before I run the code. I will attach the file just so you can see how the end result of your code looks like now. Thank you so so so so much. This is definitely the kick up the *** I needed to realise that I have got to learn how to use VBA. Honestly awesome stuff. Thanks a bunch once again.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    07-29-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    36

    Re: Convert Large Number of Cells into Seperate JPEGs

    Oh, actually, I do have one question now that I have thought about things more fully.

    Let's say in the column next to each cell, I had the name of the company buying a product. Would it be possible to "append" this to the front of the text file names without having them have images created for themselves? If this is a hassle to do, then absolutely no worries, because what you have done is already amazing and is more than good enough, but I just realised that by the time I can learn VBA well enough to edit the code sufficiently to do something like this, it would probably be at least a few months down the road. I also made some adjustments to the code as I had more time to think about how I wanted the formatting to be. Attaching the most recent version now.
    Attached Files Attached Files

+ 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. Convert text to number on large, ambiguous selection
    By bbrunof in forum Excel General
    Replies: 1
    Last Post: 03-04-2014, 01:32 PM
  2. Replies: 5
    Last Post: 03-03-2014, 05:33 AM
  3. Replies: 2
    Last Post: 05-28-2012, 08:56 PM
  4. Convert Date_Time Cell to 2 seperate cells
    By mjt57 in forum Excel General
    Replies: 8
    Last Post: 06-17-2011, 01:30 AM
  5. Convert Text to Number - Large Database
    By supplychain.dan in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-30-2009, 08:19 PM
  6. Toggle jpegs based upon number in cells
    By just66horns in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-22-2008, 05:52 PM
  7. convert a number into two seperate numbers in two different cells.
    By odin1701 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2007, 06:54 PM
  8. converting from lotus 123-is there a way to convert a large number
    By flux blocker in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-15-2005, 03:05 PM

Tags for this Thread

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