PC Review


Reply
Thread Tools Rate Thread

Append to a cell

 
 
diacci1st
Guest
Posts: n/a
 
      4th Jun 2009
Hi
I have a lst of values and a " add " button, I would like for the user to be
able to make selections and to have the results appended to a single cell so
eg:
So if I select Value 1 then click "Add" then Value 3 than "add" lets say
cell "a1" will have in it Value 1 and Value 3 as results... how can I do that?
 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      5th Jun 2009
Here is one approach.
User must select two separate cells before running the sub.
Lots still left to do if you want to make it reliable...
'--
Sub PutTogether()
Dim rng As Range
Dim rOne As Range
Dim rTwo As Range

Set rng = Selection
Set rOne = rng.Areas(1)(1)
Set rTwo = rng.Areas(2)(1)

rOne.Value = rOne.Value & " " & rTwo.Value
End Sub
--
Jim Cone
Portland, Oregon USA



"diacci1st"
<(E-Mail Removed)>
wrote in message
Hi
I have a lst of values and a " add " button, I would like for the user to be
able to make selections and to have the results appended to a single cell so
eg:
So if I select Value 1 then click "Add" then Value 3 than "add" lets say
cell "a1" will have in it Value 1 and Value 3 as results... how can I do that?
 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      5th Jun 2009
put this code into a sub and link your Add button to it

dim cell as range
dim text as string
text = range("A1").Value
for each cell in selection.cells
text = text & "," & cell.value
next
range("A1")=text


"diacci1st" <(E-Mail Removed)> wrote in message
news:BC586B66-8E78-4FDE-B4F0-(E-Mail Removed)...
> Hi
> I have a lst of values and a " add " button, I would like for the user to
> be
> able to make selections and to have the results appended to a single cell
> so
> eg:
> So if I select Value 1 then click "Add" then Value 3 than "add" lets say
> cell "a1" will have in it Value 1 and Value 3 as results... how can I do
> that?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Append name in the same cell with ' ' Ratheesh Microsoft Excel Programming 3 27th Nov 2009 06:46 PM
Copying cell into another cell but use append Garry Microsoft Excel Worksheet Functions 2 29th Mar 2009 04:38 PM
Append existing cell value =?Utf-8?B?R25lcmtz?= Microsoft Excel Programming 2 23rd Oct 2007 11:41 AM
Append Selected Cell in another Cell's Formula craigjl Microsoft Excel Programming 4 7th Apr 2006 03:59 PM
macro to append one cell to another billbeecham Microsoft Excel Programming 4 10th Nov 2004 01:23 PM


Features
 

Advertising
 

Newsgroups
 


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