How to auto-update label caption when it's look up changes?

DarkJester89

Board Regular
Joined
Nov 5, 2017
Messages
109
Office Version
  1. 2016
Platform
  1. Windows
VBA Code:
Private Sub ComboBox18_Change()
Dim Val As String

ThisWorkbook.Worksheets("User Dashboard").Range("L18").Value = Me.ComboBox18.Value
Label13.Caption = Sheets("User Dashboard").Range("K24").Text
Label13.Visible = True
End Sub

ComboBox18 starts off empty and Label is invisible

I make a selection in ComboBox1, Combox2 and Combox3, and final selection in ComboBox18, Label text becomes visible.

Adjustments to ComboBox1, Combox2 and Combox3 should update Label13 on change.

Any assistance would be much appreciated!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi,

What change is required in Label13 if we make changes in ComboBox1, Combox2 and Combox3 ?

Can you please upload your sheet to get more understanding.

Thanks,
Saurabh
 
Upvote 0
VBA Code:
Label13.Caption = Sheets("User Dashboard").Range("K24").Text

Just the value that Label13 is pulling from.
 
Upvote 0
Hi,

Please add below code.

Private Sub ComboBox1_Change()
Label13.Caption = Sheets("User Dashboard").Range("K24").Text
End Sub

Private Sub ComboBox2_Change()
Label13.Caption = Sheets("User Dashboard").Range("K24").Text
End Sub

Private Sub ComboBox3_Change()
Label13.Caption = Sheets("User Dashboard").Range("K24").Text
End Sub
 
Upvote 0
@Saurabhj

Thank you for your response!

I attempted to use what you provided in a combobox_change I had for another feature but it doesn't activate.

VBA Code:
Private Sub RankCombo_Change()
Dim Val As String

ThisWorkbook.Worksheets("User Dashboard").Range("L15").Value = Me.RankCombo.Value
Label13.Caption = Sheets("User Dashboard").Range("K24").Text
End Sub

Is there a method I need to seperate to activate the label13.caption on change?

Thank you for your assistance.
 
Upvote 0
It looks like the value of cell K24 is not being updated. If there is a formula in that cell, check its correctness. Furthermore, make sure that the worksheet is recalculated on changes.

VBA Code:
Private Sub UserForm_Initialize()
    Application.Calculation = xlCalculationAutomatic
End Sub
 
Upvote 0
I put this in rankcombo_change

VBA Code:
Sheets("User Dashboard").Calculate
Label13.Caption = Sheets("User Dashboard").Range("K24").Text

It didn't work, thank you again, nothing yet
 
Upvote 0
I assume that you have already monitored that the value of cell K24 actually changes (and nevertheless does not appear in the label).
Sounds like a mystery. What could be going on is that the Z-order of the label is different from what you assume and that it is (partly) covered by another control.
Anyway, the last two options I can come up with:
1) fully qualify your worksheet
2) yield to the OS and force a repaint of the userform (shouldn't be necessary but you never know...)
Finally, I would recommend setting a breakpoint on the Change Event procedure in VBE (F9 key). The procedure may not be triggered at all.
VBA Code:
    With ThisWorkbook.Worksheets("User Dashboard")
        .Range("L18").Value = Me.ComboBox18.Value
        Label13.Caption = .Range("K24").Text
    End With
    Label13.Visible = True
    Me.Repaint
    DoEvents
 
Upvote 0
Glad to help. Too bad you don't have a solution so far.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top