Label Caption

proctk

Well-known Member
Joined
Dec 24, 2004
Messages
839
Hi

I'm trying to get the value on my userform to equal the last value used in column 7 on sheet3.

I want it to recalculate the label value on each worksheet change.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,288
I don't actually think you will be able to use the worksheet change event with the userform.

I may be wrong though.

Perhaps you could explain further exactly what you want to do.
 

proctk

Well-known Member
Joined
Dec 24, 2004
Messages
839
Okay, I want to added to userform initialize. How would I do this
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,288
Perhaps something like this.
Code:
Label1.Caption = Worksheets("Sheet3").Cells(65536,7).End(xlUp).Value
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
Hello Kevin,
Assumming your userform is being shown as vbModeless, (which it would need to be in order for manual changes to be made while it's showing) you can use the worksheet change event like this:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
With UserForm1.Label1
    .Caption = Cells(Rows.Count, 7).End(xlUp).Value
End With
End Sub
It would probably be a good idea to use the initialize event like Norie showed you too.

Hope it helps.
Dan
 

Forum statistics

Threads
1,078,532
Messages
5,341,016
Members
399,409
Latest member
Winfield Ullrich I

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top