Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Append existing cell value | Excel Programming | |||
Append character to cell | Excel Programming | |||
Append value to cell or cells | Excel Discussion (Misc queries) | |||
File Append Row by Cell value | Excel Programming | |||
macro to append one cell to another | Excel Programming |