+ Reply to Thread
Results 1 to 6 of 6

append data from text box

  1. #1
    Qaspec
    Guest

    append data from text box

    I have a text box tb1 on sheet1 that contains a customer name. I would like
    tb1 to update the value of cell a1 on sheet2 with the customer name. In
    addition I would like to append the data each time the customer name is
    changed within the text box. So if sheet2 a1 already contains a value then
    sheet2 a2 and so on. Would it be possible to put this in a function called
    from a command button that would only update the information when the command
    button is selected and also deleted the contents of the text box after the
    update? I know this would be easily done in an access db but the employees I
    am creating this for do not have licenses to use it. Thanks for any help.

  2. #2
    Die_Another_Day
    Guest

    Re: append data from text box

    Sub AddCustomer
    if Range("A1") = "" then
    Range("A1") = tb1.Value
    Else
    Range("A" & Rows.Count).End(xlUp).Offset(1,0) = tb1.Value
    End If
    End Sub

    Add the Command Button from the forms toolbar, then choose this macro
    (AddCustomer) to be ran when clicked

    Die_Another_Day
    Qaspec wrote:
    > I have a text box tb1 on sheet1 that contains a customer name. I would like
    > tb1 to update the value of cell a1 on sheet2 with the customer name. In
    > addition I would like to append the data each time the customer name is
    > changed within the text box. So if sheet2 a1 already contains a value then
    > sheet2 a2 and so on. Would it be possible to put this in a function called
    > from a command button that would only update the information when the command
    > button is selected and also deleted the contents of the text box after the
    > update? I know this would be easily done in an access db but the employees I
    > am creating this for do not have licenses to use it. Thanks for any help.



  3. #3
    Die_Another_Day
    Guest

    Re: append data from text box

    Sub AddCustomer
    if Range("A1") = "" then
    Range("A1") = tb1.Value
    Else
    Range("A" & Rows.Count).End(xlUp).Offset(1,0) = tb1.Value
    End If
    End Sub

    Add the Command Button from the forms toolbar, then choose this macro
    (AddCustomer) to be ran when clicked

    Die_Another_Day
    Qaspec wrote:
    > I have a text box tb1 on sheet1 that contains a customer name. I would like
    > tb1 to update the value of cell a1 on sheet2 with the customer name. In
    > addition I would like to append the data each time the customer name is
    > changed within the text box. So if sheet2 a1 already contains a value then
    > sheet2 a2 and so on. Would it be possible to put this in a function called
    > from a command button that would only update the information when the command
    > button is selected and also deleted the contents of the text box after the
    > update? I know this would be easily done in an access db but the employees I
    > am creating this for do not have licenses to use it. Thanks for any help.



  4. #4
    Qaspec
    Guest

    Re: append data from text box

    If the text box and cell reference are on different sheets how does this
    affect the sub?

    "Die_Another_Day" wrote:

    > Sub AddCustomer
    > if Range("A1") = "" then
    > Range("A1") = tb1.Value
    > Else
    > Range("A" & Rows.Count).End(xlUp).Offset(1,0) = tb1.Value
    > End If
    > End Sub
    >
    > Add the Command Button from the forms toolbar, then choose this macro
    > (AddCustomer) to be ran when clicked
    >
    > Die_Another_Day
    > Qaspec wrote:
    > > I have a text box tb1 on sheet1 that contains a customer name. I would like
    > > tb1 to update the value of cell a1 on sheet2 with the customer name. In
    > > addition I would like to append the data each time the customer name is
    > > changed within the text box. So if sheet2 a1 already contains a value then
    > > sheet2 a2 and so on. Would it be possible to put this in a function called
    > > from a command button that would only update the information when the command
    > > button is selected and also deleted the contents of the text box after the
    > > update? I know this would be easily done in an access db but the employees I
    > > am creating this for do not have licenses to use it. Thanks for any help.

    >
    >


  5. #5
    Die_Another_Day
    Guest

    Re: append data from text box

    Sub AddCustomer()
    If Sheets("Sheet2").Range("A1") = "" Then
    Sheets("Sheet2").Range("A1") = Sheets("Sheet1").tb1.Value
    Else
    Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) =
    Sheets("Sheet1").tb1.Value
    End If
    End Sub

    Try that.

    Die_Another_Day
    Qaspec wrote:
    > If the text box and cell reference are on different sheets how does this
    > affect the sub?
    >
    > "Die_Another_Day" wrote:
    >
    > > Sub AddCustomer
    > > if Range("A1") = "" then
    > > Range("A1") = tb1.Value
    > > Else
    > > Range("A" & Rows.Count).End(xlUp).Offset(1,0) = tb1.Value
    > > End If
    > > End Sub
    > >
    > > Add the Command Button from the forms toolbar, then choose this macro
    > > (AddCustomer) to be ran when clicked
    > >
    > > Die_Another_Day
    > > Qaspec wrote:
    > > > I have a text box tb1 on sheet1 that contains a customer name. I would like
    > > > tb1 to update the value of cell a1 on sheet2 with the customer name. In
    > > > addition I would like to append the data each time the customer name is
    > > > changed within the text box. So if sheet2 a1 already contains a value then
    > > > sheet2 a2 and so on. Would it be possible to put this in a function called
    > > > from a command button that would only update the information when the command
    > > > button is selected and also deleted the contents of the text box after the
    > > > update? I know this would be easily done in an access db but the employees I
    > > > am creating this for do not have licenses to use it. Thanks for any help.

    > >
    > >



  6. #6
    Die_Another_Day
    Guest

    Re: append data from text box

    Sub AddCustomer()
    If Sheets("Sheet2").Range("A1") = "" Then
    Sheets("Sheet2").Range("A1") = Sheets("Sheet1").tb1.Value
    Else
    Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) =
    Sheets("Sheet1").tb1.Value
    End If
    End Sub

    Try that.

    Die_Another_Day
    Qaspec wrote:
    > If the text box and cell reference are on different sheets how does this
    > affect the sub?
    >
    > "Die_Another_Day" wrote:
    >
    > > Sub AddCustomer
    > > if Range("A1") = "" then
    > > Range("A1") = tb1.Value
    > > Else
    > > Range("A" & Rows.Count).End(xlUp).Offset(1,0) = tb1.Value
    > > End If
    > > End Sub
    > >
    > > Add the Command Button from the forms toolbar, then choose this macro
    > > (AddCustomer) to be ran when clicked
    > >
    > > Die_Another_Day
    > > Qaspec wrote:
    > > > I have a text box tb1 on sheet1 that contains a customer name. I would like
    > > > tb1 to update the value of cell a1 on sheet2 with the customer name. In
    > > > addition I would like to append the data each time the customer name is
    > > > changed within the text box. So if sheet2 a1 already contains a value then
    > > > sheet2 a2 and so on. Would it be possible to put this in a function called
    > > > from a command button that would only update the information when the command
    > > > button is selected and also deleted the contents of the text box after the
    > > > update? I know this would be easily done in an access db but the employees I
    > > > am creating this for do not have licenses to use it. Thanks for any help.

    > >
    > >



+ 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