How do I set a specific control in my userform to a specific column number based on the ActiveCell's row?
I heard you can do this in the Tag property but I am unsure.
How do I set a specific control in my userform to a specific column number based on the ActiveCell's row?
I heard you can do this in the Tag property but I am unsure.
Last edited by dssrun209; 10-12-2010 at 01:38 PM.
Userform controls are not directly associated with an worksheet objects. They are different objects. If you want associate the value of a control with the column number of the active cell then, the columns value is ActiveCell.Column. You can move this value into the control, or use it in any other way you see fit. Maybe you could describe better how you want to use the column number with the userform.
Bob
Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.
This is my part of my code when I hit the command button. But each specific textbox and combobox has to go to a specific column. So if a user adds a record, excels looks for the first empty row and puts in th values from the userform. It is at this step that I need specific control values to go to specific columns. (e.g. TextboxName is in column 4)
Please Login or Register to view this content.
Yes, the tag field could be used to assciate the control with a column. If you set the tag field to the number of the column that you want to assign the value, then you're set
Please Login or Register to view this content.
I am new to VBA, how do you set the Tag property, I know it is in the property window. I guess what i am asking is what do I type in on that blank field in the properties window?
Yes, the Tag property is in the property window of the control. You type number of the column there. If you make the Counter variable a Variant type you can type either the name or the number.
Worked like a charm, thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks