Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Append to a cell

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Append to a cell

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"

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?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Append to a cell

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"

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?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Append to a cell

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" 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
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 existing cell value Gnerks Excel Programming 2 October 23rd 07 11:41 AM
Append character to cell glenn[_3_] Excel Programming 2 September 27th 07 11:17 PM
Append value to cell or cells t2true Excel Discussion (Misc queries) 2 April 3rd 06 08:04 PM
File Append Row by Cell value Djmask[_8_] Excel Programming 3 August 22nd 05 04:37 AM
macro to append one cell to another billbeecham[_2_] Excel Programming 0 November 11th 04 07:45 PM


All times are GMT +1. The time now is 03:03 AM.

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"