+ Reply to Thread
Results 1 to 6 of 6

Properties for Label Caption when using VB Script to change.

  1. #1
    Registered User
    Join Date
    11-17-2014
    Location
    Arizona
    MS-Off Ver
    2007
    Posts
    23

    Properties for Label Caption when using VB Script to change.

    Hello Everyone,

    I have a user form that I am building and I want to have the label change from "yes" to "no" depending on data in the cell next to it.

    Select Case Inv_Val
    Case "ASSET"
    If Pay_Scan_dt = "" Then
    With Pay_ico
    .Forecolor- RGB(255, 0, 0)
    .Caption = "Y"
    End With
    Else
    With Pay_ico
    .ForeColor = RGB (51, 255, 51)
    .Caption = "N"
    End With
    End If
    End Select

    However, the Label just blanks out. Do I need to do something different in the Caption Properties to make these changes? Right now it's just blank.

    Is there something I'm missing in the code?

    Any help would be greatly appreciated!!

    Thank You

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Properties for Label Caption when using VB Script to change.

    Hi there,

    Try incorporating the following code into your UserForm CodeModule - it seems to work for me:

    Please Login or Register  to view this content.
    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    11-17-2014
    Location
    Arizona
    MS-Off Ver
    2007
    Posts
    23

    Re: Properties for Label Caption when using VB Script to change.

    Unfortunately the label is still blank - Is there something I might have to put in the properties of the Caption? Should it be blank?

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Properties for Label Caption when using VB Script to change.

    Hi again,

    Sorry - I´m away from my computer until the end of next week

    I´ll reply when I get back - sorry about the delay.

    Best regards,

    Greg M

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

    Re: Properties for Label Caption when using VB Script to change.

    What 'cell' do you want to use to determine the caption of the label?

    PS Can you add code tags when posting code?
    If posting code please use code tags, see here.

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Properties for Label Caption when using VB Script to change.

    Hi again,

    Can you post your UserForm here so we can get a better idea of what might (not?) be happening?

    Regards,

    Greg M

+ 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] Change the caption of OLEobjects label
    By SIMBAtheCAT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2014, 10:59 AM
  2. [SOLVED] Macro to change ActiveX Label Caption
    By CherylC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-02-2014, 04:52 PM
  3. [SOLVED] Change Label Caption VB...
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2013, 09:17 AM
  4. Label caption change... Run Code
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2009, 09:16 AM
  5. Label in Excel... change caption from VB
    By gonecrazybacksoon@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2006, 08:45 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