LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default cell.formula returns value

thanks for posting back and letting us know you found the problem

"Gleam" wrote:

Thank you for the ideas. It turned out that deleting blank rows below the row
in question turned the formula into a value, before it ever got to the bit of
code I posted. I have found another way of acheiving what I wanted when
deleting rows, so problem is resolved. Many thanks.

"JMB" wrote:

Since Cells(12,"D") refers to the activesheet, are you sure the sheet
containing the formula "=D11+D7" is the active sheet??

If it is possible the sheet you want may not be the active sheet when the
macro runs, you could fully qualify your reference
Sheets("SheetName").Cells(12, "D").Formula





"Gleam" wrote:

I have this line of code:
MyStr = Cells(12 , "D").Formula

I expect it to return "=D11 + D7" but it reurns the the value Cells(12 ,
"D").Value

How do I get the formula?


 
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
formula for a cell which is blank returns populated cell Gracey1 Excel Discussion (Misc queries) 1 February 2nd 07 09:17 AM
Cell reference in formula always returns a zero value Jim Alderman Excel Discussion (Misc queries) 9 November 28th 06 03:36 PM
Formula returns cell name rjvega Excel Discussion (Misc queries) 1 August 17th 06 08:36 PM
Formula returns cell name Dave F Excel Discussion (Misc queries) 0 August 17th 06 08:35 PM
Formula to sum every 4th cell returns #DIV/0! error in some column Brent Excel Worksheet Functions 5 March 16th 06 07:20 PM


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