+ Reply to Thread
Results 1 to 4 of 4

CommandButton Code

  1. #1
    Forum Contributor
    Join Date
    08-28-2005
    Posts
    132

    CommandButton Code

    I need a code for my command buttons in my userform.

    I need one code that will allow me to input the info from cell 'B10' into userform textbox 1

    I need the seceond code to allow me to empty the contents of userform textbox 2 into cell 'C10'

    I do not want this to be on code I want to use a code for each function.

    Thank you for your support.

  2. #2
    jseven
    Guest

    Re: CommandButton Code

    sub commandbutton1_click()

    textbox1.text = range("B10").value

    end sub

    sub commandbutton2_click()

    range("C10").value = textbox2.text
    end sub


  3. #3
    DMoney
    Guest

    RE: CommandButton Code

    Private Sub CommandButton1_Click()

    TextBox1.Value = Range("b10").Value
    Range("c10") = TextBox2.Value

    End Sub


    --
    EzMoney


    "oberon.black" wrote:

    >
    > I need a code for my command buttons in my userform.
    >
    > I need one code that will allow me to input the info from cell 'B10'
    > into userform textbox 1
    >
    > I need the seceond code to allow me to empty the contents of userform
    > textbox 2 into cell 'C10'
    >
    > I do not want this to be on code I want to use a code for each
    > function.
    >
    > Thank you for your support.
    >
    >
    > --
    > oberon.black
    > ------------------------------------------------------------------------
    > oberon.black's Profile: http://www.excelforum.com/member.php...o&userid=26732
    > View this thread: http://www.excelforum.com/showthread...hreadid=468099
    >
    >


  4. #4
    Forum Contributor
    Join Date
    08-28-2005
    Posts
    132
    These codes work perfectly.

    Now, I want to know if it is possible to empty the content of column B into a worksheet that as the same name as what is shown in column A.

    example

    I have 7 worksheets
    worksheet 1 ------- which has the userform in it.
    worksheet 2 ------- which is named after cell 'A10' in worksheet 1
    worksheet 3 ------- which is named after cell 'A11' in worksheet 1
    worksheet 4 ------- which is named after cell 'A12' in worksheet 1
    worksheet 5 ------- which is named after cell 'A13' in worksheet 1
    worksheet 6 ------- which is named after cell 'A14' in worksheet 1
    worksheet 7 ------- which is named after cell 'A15' in worksheet 1

    the userform
    gets information from 'a10' and inserts that information into the adjacent cell 'b10' and so on.

    I would also like to have the information inserted in to the same cells on the worksheet that is named after cell 'a10' and so on.

    What code do I need to to this?

    current code
    Please Login or Register  to view this content.

+ 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