Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Append values and remove text PurpleMilk Excel Worksheet Functions 2 December 14th 09 07:57 PM
Append text file Jeff Excel Discussion (Misc queries) 6 October 8th 07 05:56 PM
Append text Jeff Excel Discussion (Misc queries) 1 February 16th 07 10:28 PM
How do I append same text to all the cells in a column at once? Abhijit Bamishte Excel Worksheet Functions 4 December 15th 06 07:26 PM
Text Export/Append Mr. C Excel Programming 0 January 10th 06 06:36 PM


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"