Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying a row using a formula | Excel Discussion (Misc queries) | |||
copy formula result (text) only - without copying formula | Excel Discussion (Misc queries) | |||
copying the Hyperlink function result without copying the actual formula | Excel Worksheet Functions | |||
Copying formula | Excel Discussion (Misc queries) | |||
copying formula | Excel Discussion (Misc queries) |