+ Reply to Thread
Results 1 to 9 of 9

Populate Cell Comment text in UserForm TextBox

  1. #1
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Populate Cell Comment text in UserForm TextBox

    Dear All,

    I hope you're all well.

    I have a table with huge amount of data. I use a UserForm with textboxes to populate the information of the required row.

    There's a Comment Box text on a specific cell that I need to populate on one of the textboxes but I am unable to do it.

    The code I have that works well, populates the cell content:

    Please Login or Register  to view this content.
    Now, on that cell, there's a comment text that I need it populated as well on another textbox but it doesn't work. I tried:

    Please Login or Register  to view this content.
    But this doesn't work.

    Any ideas will be highly appreciated.

    Kind regards,
    Filipe

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populate Cell Comment text in UserForm TextBox

    Use Match to find the row of the cell with the comment.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Populate Cell Comment text in UserForm TextBox

    Hi Norie,

    Thanks for your help once again

    The code you sent did not worked unfortunately as I've received the following error:

    "Object Variable or With block variable not set"

    The same error I got with the above mentioned code.

    Don't know if that makes difference but the Comment text will be on column "D".

    Thanks in advance.

    Regards,
    Filipe

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populate Cell Comment text in UserForm TextBox

    Filipe

    The original code you posted would error because Application.Vlookup returns a value not a range.

    The code I posted could be erroring because there is no comment in column D.

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  5. #5
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Populate Cell Comment text in UserForm TextBox

    Hi Norie,

    Please find Example file attached.

    In Sheet1 you can see a small table that is named as "TableRange".

    Once clicking the "View Reference" you need to choose the reference from ComboBox to populate data.

    In cell C10, there's a comment that I need it populated on the UserForm TextBox31 in case I choose that reference (in that case, reference "006").

    Please let me know if you need further clarification on this matter.

    Many thanks in advance and kind regards,
    Filipe Oliveira.
    Attached Files Attached Files

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populate Cell Comment text in UserForm TextBox

    The comment is actually in column 2 (column C of the worksheet) of the range, the range is called 'TableCheck' not 'RangeCheck' and the combobox is 'ComboBox3.

    Try this.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Populate Cell Comment text in UserForm TextBox

    Thanks Norie,

    Yes, you are right, but the file I've attached is an example so the references changed, sorry.

    The code worked perfectly if I choose the reference that has a comment but if I choose other one without comments, it gives me the same error message as before:

    "Object Variable or With block variable not set"

    Maybe we should use other IF criteria?

    Thanks a million.
    Filipe

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populate Cell Comment text in UserForm TextBox

    Filipe

    To deal with there not being a comment try this.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Populate Cell Comment text in UserForm TextBox

    Thanks Norie,

    That worked perfectly!

    Thanks a million once again to help me out.

    Really appreciated.

    Best regards,
    Filipe.

+ 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. Trying to populate a userform combobox from a userform textbox
    By jtemp57 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2014, 03:33 PM
  2. [SOLVED] Userform textbox to update column (comment) ?
    By waihar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2013, 10:55 PM
  3. Replies: 0
    Last Post: 08-19-2013, 05:12 AM
  4. Want to create a leave comment textbox with userform
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2013, 09:35 PM
  5. Transferring the Userform Textbox Values To a Single Cell As Comment Indicator
    By antzint in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2012, 04:09 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