+ Reply to Thread
Results 1 to 7 of 7

Tag Property, Column Number

  1. #1
    Registered User
    Join Date
    09-10-2010
    Location
    N/A
    MS-Off Ver
    Excel 2007
    Posts
    55

    Tag Property, Column Number

    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.

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Tag Property, Column Number

    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.

  3. #3
    Registered User
    Join Date
    09-10-2010
    Location
    N/A
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Tag Property, Column Number

    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.

  4. #4
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Tag Property, Column Number

    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.

  5. #5
    Registered User
    Join Date
    09-10-2010
    Location
    N/A
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Tag Property, Column Number

    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?

  6. #6
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Tag Property, Column Number

    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.

  7. #7
    Registered User
    Join Date
    09-10-2010
    Location
    N/A
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Tag Property, Column Number

    Worked like a charm, thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1