Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting formula instead of result from cell
Try:
Debug.Print Range("A1").Formula Hope this helps Rowan lithium81 wrote: Hi, Is it possible to get the forumla from a cell instead of a the result of the forumla using VBA/Macros? e.g. In cell A1 I have the formula B1+C1. I want to retrieve this formula and furthermore it wud be great if I could get the values in B1 and C1, but I think once the formula can be extracted, the rest will be easy. Thanks!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting formula instead of result from cell
Hi, Is it possible to get the forumla from a cell instead of a the result of the forumla using VBA/Macros? e.g. In cell A1 I have the formula B1+C1. I want to retrieve this formula and furthermore it wud be great if I could get the values in B1 and C1, but I think once the formula can be extracted, the rest will be easy. Thanks!! -- lithium81 ------------------------------------------------------------------------ lithium81's Profile: http://www.excelforum.com/member.php...o&userid=29461 View this thread: http://www.excelforum.com/showthread...hreadid=494029 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting formula instead of result from cell
If you want it in a variable then:
dim strFml as string strFml = range("A1").formula Regards Rowan lithium81 wrote: Hi, Thanks! When I do the debug.print, I don't see any output, perhaps I am using it the wrong way. Could someone help please? Will this put the data into a variable? Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting formula instead of result from cell
Hi, Thanks! When I do the debug.print, I don't see any output, perhaps I am using it the wrong way. Could someone help please? Will this put the data into a variable? Thanks! -- lithium81 ------------------------------------------------------------------------ lithium81's Profile: http://www.excelforum.com/member.php...o&userid=29461 View this thread: http://www.excelforum.com/showthread...hreadid=494029 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting formula instead of result from cell
Thank you! That works great! -- lithium81 ------------------------------------------------------------------------ lithium81's Profile: http://www.excelforum.com/member.php...o&userid=29461 View this thread: http://www.excelforum.com/showthread...hreadid=494029 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting formula instead of result from cell
You're welcome.
lithium81 wrote: Thank you! That works great! |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting formula instead of result from cell
Hi lithium81,
Debug statement results from VBA code appear on the Intermediate window in the Visual Basic Editor (Ctrl+G). For what you want I would suggest the use and flexibility of a User Defined Function see GetFormula at http://www.mvps.org/dmcritchie/excel...htm#getformula if it is not obvious where the formula referenced actually is at, then a variation GetFormulaD might work better for you. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Rowan Drummond" wrote in message ... If you want it in a variable then: dim strFml as string strFml = range("A1").formula Regards Rowan lithium81 wrote: Hi, Thanks! When I do the debug.print, I don't see any output, perhaps I am using it the wrong way. Could someone help please? Will this put the data into a variable? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula for extracting numbers only from a cell | Excel Discussion (Misc queries) | |||
Formula Bar F9 Result differs from cell result??? | Excel Worksheet Functions | |||
Advanced formula - Return result & Show Cell Reference of result | Excel Worksheet Functions | |||
Cell doesn't show formula result - it shows formula (CTRL + ' doe. | Excel Worksheet Functions | |||
Question: Cell formula or macro to write result of one cell to another cell | Excel Programming |