Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm question
I have two columns of cells that I need to watch. When a user manually changes values in any cells in these two rows, an alert is generated. I can do the above easily enough. I created two UserForms, one for each row, that are generated as the alert. What I need to do is figure out how to indicate in the UserForm the row and column that caused the trigger. In my Sheet1, code, the following give me the Active Column and Active Row:
C = ActiveCell.Column R = ActiveCell.Row How can I pass these values to TextBox1 and TextBox2 on a UserForm? If I try putting this code into my UserForm, it always gives me the same values, which makes me think it is giving me the position of the UserForm on the screen, not the values of the last cell the user typed data into. Thank you in advance. Doug |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm question
Doug,
Did you Dim C & R as Public Variables??? Public C as integer Public R as Long Sub TestMe() C = ActiveCell.Column R = ActiveCell.Row UserForm1.Show End Sub In the UserForm.... Private Sub UserForm_Activate() TextBox1 = C End Sub John "Doug" wrote in message ... I have two columns of cells that I need to watch. When a user manually changes values in any cells in these two rows, an alert is generated. I can do the above easily enough. I created two UserForms, one for each row, that are generated as the alert. What I need to do is figure out how to indicate in the UserForm the row and column that caused the trigger. In my Sheet1, code, the following give me the Active Column and Active Row: C = ActiveCell.Column R = ActiveCell.Row How can I pass these values to TextBox1 and TextBox2 on a UserForm? If I try putting this code into my UserForm, it always gives me the same values, which makes me think it is giving me the position of the UserForm on the screen, not the values of the last cell the user typed data into. Thank you in advance. Doug |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform question | Excel Discussion (Misc queries) | |||
Userform question | Excel Discussion (Misc queries) | |||
Userform question | Excel Worksheet Functions | |||
Another Userform question. | Excel Discussion (Misc queries) | |||
Userform Question | Excel Discussion (Misc queries) |