Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Copying Formula


Hi all,

Is it possible to copy a formula using a macro from a
selected cell in a range to the cell directly above it?
without having to actually code the cell reference each
time?

The range I refer to can have rows deleted and inserted by
the user, thus the cell references will constantly change.

Thanks for your help


Michael

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Copying Formula

Hi Michael,

If the formula components are all relative you can make a straight copy as
follows.

Sub CopyUp1Cell()
ActiveCell.Copy ActiveCell.Offset(-1, 0)
End Sub

The above works on the activecell, but you can refer to it as you wish.

e.g. Range("H20"), cells(20, 8)

regards,
Don

--

"Michael" wrote in message
...

Hi all,

Is it possible to copy a formula using a macro from a
selected cell in a range to the cell directly above it?
without having to actually code the cell reference each
time?

The range I refer to can have rows deleted and inserted by
the user, thus the cell references will constantly change.

Thanks for your help


Michael



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Copying Formula

Sub test()

ActiveCell.Copy
ActiveCell.Offset(-1, 0).PasteSpecial
Paste:=xlPasteFormulas
End Sub

Abdul Salam

-----Original Message-----

Hi all,

Is it possible to copy a formula using a macro from a
selected cell in a range to the cell directly above it?
without having to actually code the cell reference each
time?

The range I refer to can have rows deleted and inserted

by
the user, thus the cell references will constantly

change.

Thanks for your help


Michael

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Copying Formula

Thanks Guys.
-----Original Message-----

Hi all,

Is it possible to copy a formula using a macro from a
selected cell in a range to the cell directly above it?
without having to actually code the cell reference each
time?

The range I refer to can have rows deleted and inserted

by
the user, thus the cell references will constantly change.

Thanks for your help


Michael

.

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
Copying a row using a formula Kingdazza Excel Discussion (Misc queries) 15 October 12th 08 09:01 PM
copy formula result (text) only - without copying formula Mulberry Excel Discussion (Misc queries) 2 October 2nd 08 09:51 AM
copying the Hyperlink function result without copying the actual formula mcheng Excel Worksheet Functions 2 June 9th 07 02:43 AM
Copying formula dmack Excel Discussion (Misc queries) 2 January 12th 07 03:09 PM
copying formula JG Excel Discussion (Misc queries) 9 April 4th 05 02:22 PM


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