Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Append values and remove text | Excel Worksheet Functions | |||
Append text file | Excel Discussion (Misc queries) | |||
Append text | Excel Discussion (Misc queries) | |||
How do I append same text to all the cells in a column at once? | Excel Worksheet Functions | |||
Text Export/Append | Excel Programming |