+ Reply to Thread
Results 1 to 7 of 7

VB code needed to change label when a Value ( Size of part) changes in a cell.

  1. #1
    Registered User
    Join Date
    02-17-2021
    Location
    North Carolina
    MS-Off Ver
    2010
    Posts
    4

    VB code needed to change label when a Value ( Size of part) changes in a cell.

    I have a workbook that looks like this:
    Each cell contains a number. The first two numbers are the size 16 x 25 and the corresponding label is R1 S1 (which is where they will be stored in "Row 1" "Slot 1" once these pieces are cut to size.
    I'm in need of changing the the "Row" when the size changes"??..all of the 16 x 25 are in "Row1" and corresponding slots S1, S2, S3, etc. but once it gets to the next size I need the label "Row to change to R2" and then the slots to go back to "S1, S2, etc. I hope I have explained myself well enough...

    16 25 R1 S1
    16 25 R1 S2
    16 25 R1 S3
    16 25 R1 S4
    17 35 R2 S1
    17 35 R2 S2
    18 35 R3 S1

  2. #2
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: VB code needed to change label when a Value ( Size of part) changes in a cell.

    Hi gmach5, welcome to the forum,

    I am assuming that the said numbers are in column A, so the locations will be next to that,
    perhaps this is what you are looking for:
    Please Login or Register  to view this content.
    Cheers
    Erwin
    Attached Files Attached Files
    Last edited by Eastw00d; 02-19-2021 at 04:46 AM.
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  3. #3
    Registered User
    Join Date
    02-17-2021
    Location
    North Carolina
    MS-Off Ver
    2010
    Posts
    4

    Re: VB code needed to change label when a Value ( Size of part) changes in a cell.

    I will try this out and let you know. Thank you very much!

  4. #4
    Registered User
    Join Date
    02-17-2021
    Location
    North Carolina
    MS-Off Ver
    2010
    Posts
    4

    Re: VB code needed to change label when a Value ( Size of part) changes in a cell.

    Erwin, The above code is going to work with a few tweeks. I have attached a spreadsheet for you to view. Sheet 1 has the output of the VB code above. Sheet 2 is what it needs to produce.

    First, it is copying the number from Cell A1 into the label. The label should read just R1 S1, R2 S2, etc. It does not need the size. The size of the object will be in two columns as shown in the spreadsheet. I also may need to put this into a specific cell??

    Thank you so much for helping me with this. I am learning slowly but surely......
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: VB code needed to change label when a Value ( Size of part) changes in a cell.

    OK, you did not mention, that the numbers would be in two cells (2 columns)
    So you just place the cursor in the desired column where you want the results and run the macro.

    Just one more question: is it possible that in the range of 16 (for example), besides 20, also 21 or another length exist, and must they then have another Rownumber? Because, now, basically, the rownumber changes when the first number, i.e. 16, changes.

    Please Login or Register  to view this content.
    Cheers
    Erwin

  6. #6
    Registered User
    Join Date
    02-17-2021
    Location
    North Carolina
    MS-Off Ver
    2010
    Posts
    4

    Re: VB code needed to change label when a Value ( Size of part) changes in a cell.

    Hi.
    The size of the glass will be in 2 separate cells but only the first cell needs to be checked by the VB code. More like...I hope! Smile.

    Thank you!

  7. #7
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: VB code needed to change label when a Value ( Size of part) changes in a cell.

    Glad to help & you are welcome


    If the provided solution takes care of the original question, please mark the thread as 'SOLVED' from the Thread Tools menu at top of the page & consider adding reputation(s) to those who have helped by clicking the star under their usernames.

    Cheers
    Erwin

+ 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. Data label text boxes change their size
    By erpokorp in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-09-2019, 10:14 AM
  2. [SOLVED] Steering Wheel Chart Data Label Size. How do I change the size?
    By PhilHP in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-16-2018, 08:56 PM
  3. [SOLVED] Can I change Font size without changing cell size? Or confine row height change to one col
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-10-2018, 11:18 AM
  4. Some label controls change apparent font size when moved up/down
    By GJL65 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2016, 01:12 PM
  5. [SOLVED] Change font, size, color for part of email body
    By john55 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2015, 12:48 AM
  6. Replies: 0
    Last Post: 07-09-2013, 02:21 PM
  7. how do I change the size of the y-axis label?
    By Alex in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-15-2013, 09:43 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