+ Reply to Thread
Results 1 to 5 of 5

Fit barcode to merged cell width

  1. #1
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Fit barcode to merged cell width

    Hi,

    In this example which uses the Code 128 font, I have a Userform to auto fill cells C9, G27, C22 & G28 and these then populate cells G7, G9, G20 & G22 with barcodes using the font. The Userform is normally set to autorun so that users passwords are always hidden.

    So that is the idea of how the file works, my question is...

    As peoples usernames and passwords have varying lengths, is it possible to get the barcode to autofit the width of the merged cells?

    I've tried to do a lot of research prior to asking but everything I have seen either says not to use merged cells (which means a complete redesign), or size cell to fit text, which also wouldn't work.

    I'm guessing this will need VBA to adjust height of text to fit width of cells??

    Any help greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Fit barcode to merged cell width

    Quote Originally Posted by ~TaC~ View Post
    I'm guessing this will need VBA to adjust height of text to fit width of cells??
    If you're saying that you want to fit in both height and width, then you are asking the impossible. Height and width of evey font, including barcodes are relative to each other (search font aspect ratio). If you change the height, the width will change with it and vise versa.

    It can be done in word, but not excel (I spent a lot of time trying to find a way for something that I was doing).

  3. #3
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Fit barcode to merged cell width

    Don't need height and width to fit, just width. Currently the height is much bigger than can be seen but this disappears out of cell height, I just want the width to adjust so that the width is always the same for every barcode displayed. Just so it looks more uniformed.

    If it can't be done then it can't be done, I was just trying to find out.

    Thanks for your reply.

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Fit barcode to merged cell width

    You can format the cells as 'Shrink to fit' (shift ctrl f, then go to alignment tab), but I'm not sure how well this will work for what you need.

  5. #5
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Fit barcode to merged cell width

    Sometimes its the simple things that matter lol.

    I didn't think 'Shrink to fit' worked with merged cells but it seems to.

    Thanks

+ 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] AutoFit Column Width Function Doesn't Work For Merged Cells
    By zanshin777 in forum Excel General
    Replies: 1
    Last Post: 09-27-2018, 11:20 AM
  2. automatically fit an image into merged cells for full width of merged cells
    By Marcin4111 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-18-2014, 03:12 PM
  3. [SOLVED] Merged Cell column width vs single cell column width
    By ratdogexcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2014, 12:23 AM
  4. [SOLVED] Merged Cells and Column Width
    By schmidt1962 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-24-2013, 09:19 PM
  5. [SOLVED] column width macro in merged cell seems to have problem
    By anand_erin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2012, 08:29 AM
  6. width of Merged cells within un merged cells
    By Darin Kramer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2005, 06:05 AM
  7. [SOLVED] Merged cells width
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2005, 05: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