Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default how to copy formula without changing reference

Dear Tom,

This is exactly what I want, it's great. thanks a lot.

Best regards,
jiang

"Tom Ogilvy" wrote:

Sub CopyFormulas()
Dim rng1 as Range, rng2 as Range, i as Long
on Error Resume Next
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 tousing
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

If you want them spaced out like the original selections, that would take
more work.

--
Regards,
Tom Ogilvy



"jiang" wrote in message
...
btw, tom

what I want is,
first I could select many cells, not necessary together,

Then kind of copy formula from these cells

last I go to a new position or sheet, then 'paste' formula from selected
cells. the result is , make a new copy (for instance, the cell is exactly
same including formula), but in Excel no such function.




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
Help with changing column reference in formula GoBucks[_2_] Excel Worksheet Functions 4 November 6th 09 04:54 AM
copy an exact formula without changing cell reference Vidal Excel Worksheet Functions 1 September 5th 09 09:48 AM
Copy & Paste Forumla - but reference cell is changing Andy Excel Discussion (Misc queries) 5 October 12th 07 04:41 PM
Prevent formula reference from changing ScottyC Excel Discussion (Misc queries) 3 February 9th 07 03:06 AM
HOW DO I COPY FORMULA WITHOUT CHANGING CELL REFERENCE anantth Excel Discussion (Misc queries) 4 February 6th 05 12:25 PM


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

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"