+ Reply to Thread
Results 1 to 3 of 3

Thread: Populate a column based on input from a textbox

  1. #1
    Valued Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Populate a column based on input from a textbox

    Hello Everyone.

    I would like to populate A column based on entries in a textbox after a button has been clicked. For example:

    TextBox.value = Charles Flip click a button and then cell A1.value = Charles Flip and the vlaue in the textbox is cleared. Another name can then be entered into the TextBox say TextBox.value = TIm McCoy click a button and then cell A2.value = Tim McCoy. I quess you get the point.

    I can do this for just one cell, and rewrite over it, but no populate "down" the column.
    Last edited by AnthonyWB; 02-13-2012 at 08:15 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    2,488

    Re: Populate a column based on input from a textbox

    hi AnthonyWB, example with the use of InputBox:

    Sub test()
    
    user_input = Application.InputBox(Prompt:="Your input", Title:="Enter data")
    
    If user_input <> False Then
    
        If Range("a1") = "" Then
            Range("a1") = user_input
        Else
            Cells(Rows.Count, 1).End(xlUp).Offset(1) = user_input
        End If
    
    End If
    
    End Sub

  3. #3
    Valued Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Populate a column based on input from a textbox

    sev,

    thanks. input box may get me started, but i should have clarified that the button and the textbox are on a userform. i forgot that.

+ 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.2.0