Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Greetings all, I am receiving an 'Application-defined or Object-defined' Run-time error on some simple code but I can not for the life of me get it to work. I am using 2003 and trying to just insert a formula into a selected range of rows down a column. Code: -------------------- Dim cell As Range Sub insertLineSellFormula() For Each cell In Selection cell.Formula = "=OFFSET(" & cell.Address & ",0,-2)/(1-OFFSET(" & cell.Address & ",0,-1)" Next cell End Sub -------------------- Oddly enough I can reference the cell object to alter other properties of it within the loop (clear it, apply conditional formats, ect.) but when I attempt to insert the formula or a .Value I get the run-time error. As always any insight you guys may have is very much appreciated. Thanks! -- Josh22 ------------------------------------------------------------------------ Josh22's Profile: http://www.excelforum.com/member.php...o&userid=24080 View this thread: http://www.excelforum.com/showthread...hreadid=393114 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro error, range object need data? | Charts and Charting in Excel | |||
Object range method runtime error | Excel Programming | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Adding named range gives error "method range of object _Global failed " | Excel Programming | |||
Range object failed - random error | Excel Programming |