Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to enter value of a formula in vba
Please help I am not sure why .Value does not work for me. Do While ActiveCell.Offset(0, 1).Value < Empty ActiveCell*.Value* = "=If(R[0]C[1]<R[0]C[2],R[0]C[1]&"" ""&R[0]C[2],R[0]C[2]&"" ""&R[0]C[2])" ActiveCell.Offset(1, 0).Select Loop -- shternm ------------------------------------------------------------------------ shternm's Profile: http://www.excelforum.com/member.php...nfo&userid=858 View this thread: http://www.excelforum.com/showthread...hreadid=486065 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to enter value of a formula in vba
Try
ActiveCell.Formula = "=If(R[0]C[1]<R[0]C[2],R[0]C[1]&"" ""&R[0]C[2],R[0]C[2]&"" ""&R[0]C[2])" Regards, Alan. "shternm" wrote in message ... Please help I am not sure why .Value does not work for me. Do While ActiveCell.Offset(0, 1).Value < Empty ActiveCell*.Value* = "=If(R[0]C[1]<R[0]C[2],R[0]C[1]&"" ""&R[0]C[2],R[0]C[2]&"" ""&R[0]C[2])" ActiveCell.Offset(1, 0).Select Loop -- shternm ------------------------------------------------------------------------ shternm's Profile: http://www.excelforum.com/member.php...nfo&userid=858 View this thread: http://www.excelforum.com/showthread...hreadid=486065 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to enter value of a formula in vba
That doesn't work either. Just so I am making myself clear: I don't want to see the formula in the cell just a result (value). -- shternm ------------------------------------------------------------------------ shternm's Profile: http://www.excelforum.com/member.php...nfo&userid=858 View this thread: http://www.excelforum.com/showthread...hreadid=486065 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to enter value of a formula in vba
Apologies,
I didn't look carefully enough at your query. I see now what you mean. I would repost this in 'Programming', The VB experts are there although I'm not sure this can be done directly in code, it may have to refer to a worksheet formula, I'll look forward to the answers, Good Luck, Regards, Alan. "shternm" wrote in message ... That doesn't work either. Just so I am making myself clear: I don't want to see the formula in the cell just a result (value). -- shternm ------------------------------------------------------------------------ shternm's Profile: http://www.excelforum.com/member.php...nfo&userid=858 View this thread: http://www.excelforum.com/showthread...hreadid=486065 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to enter value of a formula in vba
Maybe activecell.formular1c1 would work.
shternm wrote: Please help I am not sure why .Value does not work for me. Do While ActiveCell.Offset(0, 1).Value < Empty ActiveCell*.Value* = "=If(R[0]C[1]<R[0]C[2],R[0]C[1]&"" ""&R[0]C[2],R[0]C[2]&"" ""&R[0]C[2])" ActiveCell.Offset(1, 0).Select Loop -- shternm ------------------------------------------------------------------------ shternm's Profile: http://www.excelforum.com/member.php...nfo&userid=858 View this thread: http://www.excelforum.com/showthread...hreadid=486065 -- Dave Peterson |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to enter value of a formula in vba
Try:
With ActiveCell .FormulaR1C1 = "=If(R[0]C[1]<R[0]C[2],R[0]C[1]&""""&" _ & "R[0]C[2],R[0]C[2]&"" ""&R[0]C[2])" .Value = .Value End With Hope this helps Rowan shternm wrote: That doesn't work either. Just so I am making myself clear: I don't want to see the formula in the cell just a result (value). |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to enter value of a formula in vba
Thank you - that works great. Can you explain why that works? -- shternm ------------------------------------------------------------------------ shternm's Profile: http://www.excelforum.com/member.php...nfo&userid=858 View this thread: http://www.excelforum.com/showthread...hreadid=486065 |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to enter value of a formula in vba
The code inserts the formula into the cell and then replaces the formula
with the value of the cell. So it works a bit like typing in the formula and then doing a copy pastespecial values over the formula. Regards Rowan shternm wrote: Thank you - that works great. Can you explain why that works? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I enter a formula in a comment? | Excel Worksheet Functions | |||
Trying to enter a range of numbers using >1 and < 5 in a formula | Excel Worksheet Functions | |||
Formula for Excel: C3-AC3, then C3-C25...how do I enter it? | Excel Worksheet Functions | |||
Aligning Two Lists in Excel | Excel Discussion (Misc queries) | |||
Can you enter a formula in a cell that auto-inputs calculations a. | Excel Worksheet Functions |