Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 55
Default Paste into a filled cell

Is it possible to copy one cell and paste it into another occupied cell
without removing what is already there? Guess we could call that appending
to what is in the existing cell.
Thx
Dave


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 247
Default Paste into a filled cell

i would say yes.The answer depends a little bit on what how you want to do
it,and on the "stuff" thats already in the cell.Is this a one off operation
to update some data,or something tha will need to be done all the time or
every day/week/month?Give us an ezample of the data you have got,what you
want to add,and we will on our way!
--
paul

remove nospam for email addy!



"Dave" wrote:

Is it possible to copy one cell and paste it into another occupied cell
without removing what is already there? Guess we could call that appending
to what is in the existing cell.
Thx
Dave



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 55
Default Paste into a filled cell

Thanks for the reply Paul -

Lets say A1 is (c*(1+c)^n) and A2 is ((1+c )^n-1) I am currently adding A1
and A2 in A3. It would be handy to copy/paste the contents of A2 into A1
(and add a + sign) and get the result directly.

This are partial examples (i.e., don't make much sense by themselves), but I
have many similar situations. Just looking for an easy way out.

BTW, the point of breaking down these kinds of things is to help
troubleshoot them when they (almost inevitably) don't get the correct result
on the first trial.

Dave

"paul" wrote in message
...
i would say yes.The answer depends a little bit on what how you want to do
it,and on the "stuff" thats already in the cell.Is this a one off
operation
to update some data,or something tha will need to be done all the time or
every day/week/month?Give us an ezample of the data you have got,what you
want to add,and we will on our way!
--
paul

remove nospam for email addy!



"Dave" wrote:

Is it possible to copy one cell and paste it into another occupied cell
without removing what is already there? Guess we could call that
appending
to what is in the existing cell.
Thx
Dave





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default Paste into a filled cell

Dave wrote:
Thanks for the reply Paul -

Lets say A1 is (c*(1+c)^n) and A2 is ((1+c )^n-1) I am currently adding A1
and A2 in A3. It would be handy to copy/paste the contents of A2 into A1
(and add a + sign) and get the result directly.

This are partial examples (i.e., don't make much sense by themselves), but I
have many similar situations. Just looking for an easy way out.

BTW, the point of breaking down these kinds of things is to help
troubleshoot them when they (almost inevitably) don't get the correct result
on the first trial.

Dave


Hi Dave,

I don't know if this macro will do what you want...

Public Sub Append()
Dim rngAppend As Range
Dim rngAccept As Range
Dim rngCellAppend As Range
Dim rngCellAccept As Range
Dim I As Long
Dim blnWrongSelection As Boolean
Do
On Error GoTo CANCELLED
Set rngAppend = Application.InputBox( _
prompt:="Select Cells containing appendices.", _
Title:="Range of Appendices", _
Default:=Selection.Address, _
Type:=8)
On Error GoTo 0
If rngAppend.Areas.Count 1 Then
MsgBox "Cannot do this to a multi-area selection."
End If
Loop While rngAppend.Areas.Count 1
Do
blnWrongSelection = False
On Error GoTo CANCELLED
Set rngAccept = Application.InputBox( _
prompt:="Select Cells to receive appendices.", _
Title:="Range of Receiving Cells", _
Type:=8)
On Error GoTo 0
If rngAppend.Rows.Count < rngAccept.Rows.Count Or _
rngAppend.Columns.Count < rngAccept.Columns.Count Then
blnWrongSelection = True
MsgBox "range of receiving cells must be " & _
rngAppend.Rows.Count & _
" Rows by " & rngAppend.Columns.Count & " Columns"
End If
Loop While blnWrongSelection
For Each rngCellAccept In rngAccept
I = I + 1
Select Case rngCellAccept.HasFormula
Case True
If Not WorksheetFunction.IsNumber(rngAppend.Cells(I).Valu e) Then
rngCellAccept.Value = rngCellAccept.Value & _
" + " & rngAppend.Cells(I).Value
Else: rngCellAccept.Formula = rngCellAccept.Formula _
& "+" & Right(rngAppend.Cells(I).Formula _
, Len(rngAppend.Cells(I).Formula) - 1)
End If
Case False
rngCellAccept.Value = rngCellAccept.Value & _
" + " & rngAppend.Cells(I).Value
End Select
Next
CANCELLED:
End Sub

The user is prompted to select the range of cells containing
appendices, then a range of cells for receiving the appendices (both
ranges must have same numbers of rows and columns).
With receiving cells that have a formula the appendix is added with a
"+" so that the result is still a formula eg receiving cell had formula
=SUM(A1:A10) becomes =SUM(A1:A10)+SUM(B1:B10) if appendix cell had
formula =SUM(B1:B10) or becomes =SUM(A1:A10)+5 if appendix cell is a
constant number. The exception is when the appendix cell is either
constant text or text resulting from a formula, then the receiving
cell's value is concatenated with " + " and the appendix cell value.
With receiving cells that don't have a formula, the receiving cell's
value is concatenated with " + " and the appendix cell value.

Ken Johnson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 55
Default Paste into a filled cell

Whoa !

Holly mackerel, Ken, I'm impressed. I'm not that much on macros, and it's
going to take me a while, but I'll give it a shot. Whether it's what I want
or not, seriously I must say I appreciate the time and talent that went into
tailoring the routine. Very impressive - and I appreciate it very much.

Wish me luck

Dave



"Ken Johnson" wrote in message
oups.com...
Dave wrote:
Thanks for the reply Paul -

Lets say A1 is (c*(1+c)^n) and A2 is ((1+c )^n-1) I am currently adding
A1
and A2 in A3. It would be handy to copy/paste the contents of A2 into A1
(and add a + sign) and get the result directly.

This are partial examples (i.e., don't make much sense by themselves),
but I
have many similar situations. Just looking for an easy way out.

BTW, the point of breaking down these kinds of things is to help
troubleshoot them when they (almost inevitably) don't get the correct
result
on the first trial.

Dave


Hi Dave,

I don't know if this macro will do what you want...

Public Sub Append()
Dim rngAppend As Range
Dim rngAccept As Range
Dim rngCellAppend As Range
Dim rngCellAccept As Range
Dim I As Long
Dim blnWrongSelection As Boolean
Do
On Error GoTo CANCELLED
Set rngAppend = Application.InputBox( _
prompt:="Select Cells containing appendices.", _
Title:="Range of Appendices", _
Default:=Selection.Address, _
Type:=8)
On Error GoTo 0
If rngAppend.Areas.Count 1 Then
MsgBox "Cannot do this to a multi-area selection."
End If
Loop While rngAppend.Areas.Count 1
Do
blnWrongSelection = False
On Error GoTo CANCELLED
Set rngAccept = Application.InputBox( _
prompt:="Select Cells to receive appendices.", _
Title:="Range of Receiving Cells", _
Type:=8)
On Error GoTo 0
If rngAppend.Rows.Count < rngAccept.Rows.Count Or _
rngAppend.Columns.Count < rngAccept.Columns.Count Then
blnWrongSelection = True
MsgBox "range of receiving cells must be " & _
rngAppend.Rows.Count & _
" Rows by " & rngAppend.Columns.Count & " Columns"
End If
Loop While blnWrongSelection
For Each rngCellAccept In rngAccept
I = I + 1
Select Case rngCellAccept.HasFormula
Case True
If Not WorksheetFunction.IsNumber(rngAppend.Cells(I).Valu e) Then
rngCellAccept.Value = rngCellAccept.Value & _
" + " & rngAppend.Cells(I).Value
Else: rngCellAccept.Formula = rngCellAccept.Formula _
& "+" & Right(rngAppend.Cells(I).Formula _
, Len(rngAppend.Cells(I).Formula) - 1)
End If
Case False
rngCellAccept.Value = rngCellAccept.Value & _
" + " & rngAppend.Cells(I).Value
End Select
Next
CANCELLED:
End Sub

The user is prompted to select the range of cells containing
appendices, then a range of cells for receiving the appendices (both
ranges must have same numbers of rows and columns).
With receiving cells that have a formula the appendix is added with a
"+" so that the result is still a formula eg receiving cell had formula
=SUM(A1:A10) becomes =SUM(A1:A10)+SUM(B1:B10) if appendix cell had
formula =SUM(B1:B10) or becomes =SUM(A1:A10)+5 if appendix cell is a
constant number. The exception is when the appendix cell is either
constant text or text resulting from a formula, then the receiving
cell's value is concatenated with " + " and the appendix cell value.
With receiving cells that don't have a formula, the receiving cell's
value is concatenated with " + " and the appendix cell value.

Ken Johnson





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default Paste into a filled cell


Dave wrote:
Whoa !

Holly mackerel, Ken, I'm impressed. I'm not that much on macros, and it's
going to take me a while, but I'll give it a shot. Whether it's what I want
or not, seriously I must say I appreciate the time and talent that went into
tailoring the routine. Very impressive - and I appreciate it very much.

Wish me luck

Dave


Hi Mark,

I wish you all the luck in the world.

Let me know how you go.

Ken

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
formula won't paste from one cell to another with current cell inf kentndebra Excel Worksheet Functions 1 August 22nd 06 04:52 PM
?IF function for preventing a cell being filled by formula confused teacher Excel Worksheet Functions 3 July 6th 06 06:01 AM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
Paste Link enters a 0 into the cell where I paste. How do I elemin UNR Excel Discussion (Misc queries) 4 March 28th 05 01:54 AM
excel - numbers as text Thuferhawat New Users to Excel 12 January 24th 05 09:29 PM


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

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

About Us

"It's about Microsoft Excel"