+ Reply to Thread
Results 1 to 25 of 25

UserForm - Update Label with sheets

  1. #1
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    UserForm - Update Label with sheets

    Hello,
    I hava a problem
    I would like the values ​​on the label to be updated.
    Everything in the attachment
    Please help.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: UserForm - Update Label with sheets

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    Thank you, but something does not work
    Attached Files Attached Files

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: UserForm - Update Label with sheets

    Try the attached.
    YasserKhalil's code does work if it is actually in the right place
    Form first fellover because insufficient labels to receive data requested.
    Press 'SHOW FORM' button and all will be revealed.
    torachan.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    Thanks, but I made a mistake :/
    Please Login or Register  to view this content.
    This code must add up to 8 characters from the left.

    And the last problem, after adding a new value, the label does not update.


    Sorry for the confusion.
    Attached Images Attached Images
    Attached Files Attached Files

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: UserForm - Update Label with sheets

    It is not possible for the label to update beyond what is in sheet "A2"
    How are you updating the data in "A2"

  7. #7
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    Copies manually to A2.
    Textbox.1 to A1 lastrow.
    It's not a big problem like this This ... code must add up to 8 characters from the left.

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: UserForm - Update Label with sheets

    To view just the leading eight characters alter your code
    from
    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    also labels 8 & 9 are reversed on the form

    HOWEVER:- Garbage in, Garbage Out.
    You have 10 entries on "A1" with a count of 12 on "A2"
    Manual entry onto "A2" is not a good idea.
    Perhaps time to re-visit the concept ?

  9. #9
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    Thanks, but I do not mean it.
    A2 :
    P3/1231B
    A1 :
    P3/1231B 13
    P3/1231B 14
    P3/1231B 15
    P3/1231B 16

    Left on A1 no A2.
    Score is : P3/1231B 4/4.

    And display no last 9 in A2, but last 9 A1.
    I described everything in the attachment
    Attached Files Attached Files
    Last edited by Bolo19911; 02-02-2019 at 12:08 PM.

  10. #10
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: UserForm - Update Label with sheets

    Capture.JPG

    I have pasted data from "A1" alongside data on "A2"
    Sorted and grouped.
    Please explain what the numbers in column "B" relate too.
    They do not appear to have any logical relationship to column "A" or "D"

  11. #11
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    Column B = general amount.
    e.g - P8/0101A - total value = 11
    Column D are scans, because can be them max 11. In this case 2. = 2/11.
    When they appear new scans e.g - P8/0101A 13, value = 3/11 and so on.
    Column A - contract number

    Fixed values = A And B

    Variable values = D
    Last edited by Bolo19911; 02-02-2019 at 02:57 PM.

  12. #12
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: UserForm - Update Label with sheets


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

    Re: UserForm - Update Label with sheets

    For starters.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by bakerman2; 02-02-2019 at 11:31 PM.
    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.

  14. #14
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    Bakerman2, perfect !!!
    Thanks.

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

    Re: UserForm - Update Label with sheets

    Glad to help and thanks for rep+.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  16. #16
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    bakerman2,
    I have one question
    CURRENTLY - FIRST 10 ON A2
    EXPECTED - LAST 10 ON A1

    CAN BE ?
    Attached Files Attached Files

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

    Re: UserForm - Update Label with sheets

    It's possible but how to know how many items for each value.
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    Maybe 1 label with function Multiline ?
    It will not be easier ?

    Or reference to the control ... separately e.g :
    Please Login or Register  to view this content.
    10
    Please Login or Register  to view this content.
    9
    Please Login or Register  to view this content.
    8
    e.g
    Attached Images Attached Images
    Last edited by Bolo19911; 02-03-2019 at 10:30 AM.

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

    Re: UserForm - Update Label with sheets

    What I mean is on sheet A2 whe have our numbers in A-Column and the number of items in B-Column.

    If we extract the last 10 on A1 how are we to know how many items for each number are needed to make our fraction. eg 1/2 or 2/10 or 3/7 ?

  20. #20
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    can be displayed on 1 label ?

    this macro can stay :
    Please Login or Register  to view this content.
    in this way I see the problem in :

    Please Login or Register  to view this content.
    "i" depending on the label.
    I would like to one label on multiline + the above macro (tst).
    "i" the range is the entire column - "A" in A2
    I do not see any other way

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

    Re: UserForm - Update Label with sheets

    I'd go for a Listbox instead of a multiline Label because that's easier to handle.

    But first you need to answer my question before we can proceed.

    In all your previous examples the numbers on Sheet A2 Column A were predefined along with their general amount in Column B.

    Now you want to retrieve the last 10 numbers on Sheet A1 and put them in Column A of Sheet A2. Were do we retrieve the general amount for these numbers in Column B ?????

    Edit: Added example file with a ListBox.
    Attached Files Attached Files
    Last edited by bakerman2; 02-03-2019 at 09:28 PM.

  22. #22
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    Thanks for reply,it's better but.
    Well, we need to get the general value from column B.
    He is almost good, but ,I want to display only 10 current columns from A1, because the values ​​are variable, they can be 100,000.
    Why ?
    These are scans from the scanner
    Sheet A2 is only for comparison with the last 10 contracts with A1.
    Attached Images Attached Images

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

    Re: UserForm - Update Label with sheets

    Finaly, thank you.

    This should cover it all.
    Please Login or Register  to view this content.

  24. #24
    Registered User
    Join Date
    12-23-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    12

    Re: UserForm - Update Label with sheets

    Perfect Thanks

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

    Re: UserForm - Update Label with sheets

    Glad we got it sorted.

+ 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] update label caption on userform when combobox selection changes
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2016, 09:36 PM
  2. dynamic generated mousemove of checkboxes in userform to update a single label
    By mynameisnfs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-22-2014, 04:18 PM
  3. VBA Code to automatically update label in the userform
    By sn152 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2014, 06:29 PM
  4. Use variable as name for label in userform, dynamically update different labels
    By seaofgreen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2013, 04:12 PM
  5. Trying to Update Userform Label with worksheet cells
    By bmoon171 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2013, 07:59 PM
  6. Real time update of Userform label with cell value
    By KyleLee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2009, 09:58 AM
  7. Dynamic Userform doesnt update label caption
    By Heresy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-10-2009, 11:59 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