Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
aw aw is offline
external usenet poster
 
Posts: 19
Default range of Formula copy but not changing the content

I would like to ask if any way I can copy formula from range to another range
but the formula will still remain unchange as the source content. (i.e. EXCEL
will not change the related cell automatically)
i.e. copy formula from "C1" to "D1" but formula in D1 should same as C1
(C1 will NOT change its formula to sum(a2:b2)

12 12 24 =SUM(A1:B1)
342 342
523 523

Tx a lot for your kind assistance.
--
aw
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default range of Formula copy but not changing the content

Select (highlight) the formula in the formula bar and then copy.

Press Enter.

Select the new cell and paste.

Ensure that you press Enter after highlighting and copying otherwise it will
alter your formula when you select another cell.
--
Regards,

OssieMac


"aw" wrote:

I would like to ask if any way I can copy formula from range to another range
but the formula will still remain unchange as the source content. (i.e. EXCEL
will not change the related cell automatically)
i.e. copy formula from "C1" to "D1" but formula in D1 should same as C1
(C1 will NOT change its formula to sum(a2:b2)

12 12 24 =SUM(A1:B1)
342 342
523 523

Tx a lot for your kind assistance.
--
aw

  #3   Report Post  
Posted to microsoft.public.excel.misc
aw aw is offline
external usenet poster
 
Posts: 19
Default range of Formula copy but not changing the content

Thanks for help.

Actually my actual formula should be much longer that this & should be
copied across worksheets from range (more than 1 cell) to another.

Is there another way to do? Or may you give me some hints for writting VB
for this function.

Tx a lot!!
--
aw


"OssieMac" wrote:

Select (highlight) the formula in the formula bar and then copy.

Press Enter.

Select the new cell and paste.

Ensure that you press Enter after highlighting and copying otherwise it will
alter your formula when you select another cell.
--
Regards,

OssieMac


"aw" wrote:

I would like to ask if any way I can copy formula from range to another range
but the formula will still remain unchange as the source content. (i.e. EXCEL
will not change the related cell automatically)
i.e. copy formula from "C1" to "D1" but formula in D1 should same as C1
(C1 will NOT change its formula to sum(a2:b2)

12 12 24 =SUM(A1:B1)
342 342
523 523

Tx a lot for your kind assistance.
--
aw

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default range of Formula copy but not changing the content

Select the formu;a(s) to copy.

EditReplace

What: =
With: ^^^

Replace all.

Copy and paste then reverse the process.

Couple of other methods can be found at John Walkenbach's site.

One without VBA and one with.

http://www.j-walk.com/ss/excel/usertips/tip066.htm

Here also is a macro that is not range specific.

Forgot who was the originator so no attribution.

Sub CopyFormulasExact()
Dim rngCopyFrom As Range
Dim rngCopyTo As Range
Dim intColCount As Integer
Dim intRowCount As Integer

' Check that a range is selected
If Not TypeName(Selection) = "Range" Then End
' check that the range has only one area
If Not Selection.Areas.Count = 1 Then
MsgBox "Multiple Selections Not Allowed", vbExclamation
End
End If

' Assign selection to object variable
Set rngCopyFrom = Selection
If Not Selection.HasFormula Then
MsgBox "Cells do not contain formulas"
End
End If

' This is required in case cancel is clicked.
' Type 8 input box returns a range object if OK is
' clicked or False if cancel is clicked. I do not
' know of a way to test for both cases without
' using error trapping
On Error GoTo UserCancelled

' Assign object variable to user-selected cell
Set rngCopyTo = Application.InputBox( _
prompt:="Select the UPPER LEFT CELL of the " _
& "range to which you wish to paste", _
Title:="Copy Range Formulae", Type:=8).Cells(1, 1)

On Error GoTo 0

' Loop through source range assigning any formulae found
' to the equivalent cell of the destination range.
For intColCount = 1 To rngCopyFrom.Columns.Count
For intRowCount = 1 To rngCopyFrom.Rows.Count
If rngCopyFrom.Cells(intRowCount, _
intColCount).HasFormula Then
rngCopyTo.Offset(intRowCount - 1, _
intColCount - 1).Formula = _
rngCopyFrom.Cells(intRowCount, _
intColCount).Formula
End If
Next intRowCount
Next intColCount

UserCancelled:
End Sub


Gord Dibben MS Excel MVP


On Mon, 19 Nov 2007 19:23:01 -0800, aw wrote:

Thanks for help.

Actually my actual formula should be much longer that this & should be
copied across worksheets from range (more than 1 cell) to another.

Is there another way to do? Or may you give me some hints for writting VB
for this function.

Tx a lot!!


  #5   Report Post  
Posted to microsoft.public.excel.misc
aw aw is offline
external usenet poster
 
Posts: 19
Default range of Formula copy but not changing the content

Dear all,

It's work great. Thanks a lot!!
--
aw


"Gord Dibben" wrote:

Select the formu;a(s) to copy.

EditReplace

What: =
With: ^^^

Replace all.

Copy and paste then reverse the process.

Couple of other methods can be found at John Walkenbach's site.

One without VBA and one with.

http://www.j-walk.com/ss/excel/usertips/tip066.htm

Here also is a macro that is not range specific.

Forgot who was the originator so no attribution.

Sub CopyFormulasExact()
Dim rngCopyFrom As Range
Dim rngCopyTo As Range
Dim intColCount As Integer
Dim intRowCount As Integer

' Check that a range is selected
If Not TypeName(Selection) = "Range" Then End
' check that the range has only one area
If Not Selection.Areas.Count = 1 Then
MsgBox "Multiple Selections Not Allowed", vbExclamation
End
End If

' Assign selection to object variable
Set rngCopyFrom = Selection
If Not Selection.HasFormula Then
MsgBox "Cells do not contain formulas"
End
End If

' This is required in case cancel is clicked.
' Type 8 input box returns a range object if OK is
' clicked or False if cancel is clicked. I do not
' know of a way to test for both cases without
' using error trapping
On Error GoTo UserCancelled

' Assign object variable to user-selected cell
Set rngCopyTo = Application.InputBox( _
prompt:="Select the UPPER LEFT CELL of the " _
& "range to which you wish to paste", _
Title:="Copy Range Formulae", Type:=8).Cells(1, 1)

On Error GoTo 0

' Loop through source range assigning any formulae found
' to the equivalent cell of the destination range.
For intColCount = 1 To rngCopyFrom.Columns.Count
For intRowCount = 1 To rngCopyFrom.Rows.Count
If rngCopyFrom.Cells(intRowCount, _
intColCount).HasFormula Then
rngCopyTo.Offset(intRowCount - 1, _
intColCount - 1).Formula = _
rngCopyFrom.Cells(intRowCount, _
intColCount).Formula
End If
Next intRowCount
Next intColCount

UserCancelled:
End Sub


Gord Dibben MS Excel MVP


On Mon, 19 Nov 2007 19:23:01 -0800, aw wrote:

Thanks for help.

Actually my actual formula should be much longer that this & should be
copied across worksheets from range (more than 1 cell) to another.

Is there another way to do? Or may you give me some hints for writting VB
for this function.

Tx a lot!!



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
How to copy range without changing formulas? [email protected] Excel Discussion (Misc queries) 3 December 31st 06 10:01 PM
Copy formula into multiple cells without changing range frankjh19701 Excel Worksheet Functions 4 December 28th 06 03:45 PM
Copy the formatting and content of a range davidthegolfer Excel Discussion (Misc queries) 2 February 22nd 06 03:43 PM
Changing named range reference depending on a cell's content cparaske Excel Discussion (Misc queries) 1 July 29th 05 07:06 PM
How do you copy RANK w/o it changing the range? jspan Excel Worksheet Functions 1 June 21st 05 02:56 AM


All times are GMT +1. The time now is 12:33 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"