LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Copy Formula without changing cell refence

Hi,

I modified this macro from earlier post fom Tom Ogilvy, but it is doing
exactly what it should be. I like to copy the formula in a selected
cell(s) and paste them in another cell without changing the cell
reference. Can someone help, please?

Thank you in advance.

Agustus

Sub CopyFormulas1()
Dim rng1 As Range, rng2 As Range, i As Long
On Error Resume Next
Set rng1 = Selection.CurrentRegion
' original post had this: Set rng1 = Application.InputBox("Select cells
to copy using mouse", Type:=8)
On Error GoTo 0
If rng1 Is Nothing Then
MsgBox "You selected nothing"
Exit Sub
End If

On Error Resume Next
Set rng2 = Application.InputBox("Select top cell to paste using mouse",
_
Type:=8)
On Error GoTo 0
If rng2 Is Nothing Then
MsgBox "You selected nothing"
Exit Sub
End If

i = 1
For Each cell In rng1
rng2(i).Formula = cell.Formula
i = i + 1
Next

End Sub

 
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
copy an exact formula without changing cell reference Vidal Excel Worksheet Functions 1 September 5th 09 09:48 AM
refence worksheet name into a formula excelhurtsme Excel Discussion (Misc queries) 5 October 20th 08 04:46 PM
Way To Copy Formula In Column Without Changing All Cell Numbers travelersway Excel Discussion (Misc queries) 2 September 3rd 05 08:36 PM
HOW DO I COPY FORMULA WITHOUT CHANGING CELL REFERENCE anantth Excel Discussion (Misc queries) 4 February 6th 05 12:25 PM
Problem with Active Cell Refence patterson_m Excel Programming 1 October 10th 03 06:34 PM


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