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: 118
Default Copy formula - Tom Ogilvy

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


Coulp Tom or someone else make the above formula work for both a
vertical & horizontal range.As it's now pasting range vertically even
if a horizontal range has been copied.

Thxs a lot

 
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
Tom Ogilvy - More help please Tempy Excel Programming 4 May 20th 05 07:20 AM
Tom Ogilvy halem2[_26_] Excel Programming 4 September 17th 04 03:26 PM
Thank u Tom Ogilvy helmekki[_19_] Excel Programming 0 August 7th 04 04:31 PM
Tom Ogilvy David Joseph Excel Programming 0 April 21st 04 02:57 PM
For Tom Ogilvy re Copy Sheet Problem Jim[_34_] Excel Programming 1 January 3rd 04 02:41 PM


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