View column A value based on the active cell

JohnBi

New Member
Joined
Aug 1, 2016
Messages
31
Office Version
  1. 2019
Platform
  1. Windows
Hello to everyone,
how may I see in a TextBox the value of a cell in colum A based on the active cell?
For example:
- Active cell = H25 --> Textbox = A25 value
- Active cell = H20 --> Textbox = A20 value
- Active cell = C125 --> Textbox = A125 value
- Active cell = F87 --> Textbox = A87 value

Thank you for your help.
Regards
John
 
OK, I thought you just had a textbox on worksheet directly.
If it is textbox on a UserForm, then you just should put the one line of code I originally gave you to whatever code is bringing up the UserForm.
I add your code on the UserForm_Initialize() and the first time I open the form is Ok.
Then, when I made changes in the range C11:H133 the textbox is not anymore updated. I need to close and reopen.
Regards
John
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
So, you have the UserForm open the entire time, and you want the UserForm to be updated automatically and immediately while you are updating cells on the worksheet?
It seems kind of odd to have both open and being updated at the same time.
What exactly are you doing?
 
Upvote 0
OK, I seldom work with user forms, but I just did some research, and it looks to me that you just need to add a User Form reference in front of the text box name, as shown here:
i.e.
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
'   See if update happened in range C11:H133
    If Not Intersect(Target, Range("C11:H133")) Is Nothing Then
        UserForm1.TextBox5.Value = Cells(ActiveCell.Row, "A").Value
    End If
End Sub
 
Upvote 0
Solution
Sir, thank you, and thank you again.
It is perfect!

Regards
John
 
Upvote 0
You are welcome.
Glad we were able to figure it all out!
:)
 
Upvote 0

Forum statistics

Threads
1,215,019
Messages
6,122,707
Members
449,093
Latest member
Mnur

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