Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform question Brad Excel Discussion (Misc queries) 4 March 15th 10 04:43 PM
Userform question ub Excel Discussion (Misc queries) 0 February 19th 09 06:56 PM
Userform question Anthony Excel Worksheet Functions 4 June 27th 08 04:26 PM
Another Userform question. ingleg Excel Discussion (Misc queries) 1 July 6th 06 01:17 PM
Userform Question Greg B Excel Discussion (Misc queries) 3 March 10th 05 10:46 AM


All times are GMT +1. The time now is 11:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"