Returning a value, not a formula

zx12r
04-11-2006, 12:21 PM
Hey all, I need a little help with something pretty basic. I have a macro that performs a simple calculation. How do I return only the result, the integer information, to the cell without the formula tracking along with it?

ActiveCell.FormulaR1C1 = "=R[-1]C+1"

Thanks for any help on this! :)

zx12r
04-11-2006, 12:25 PM
I've been trying something like this...

Dim z As Integer

Set z = ActiveCell.FormulaR1C1 = "=R[-1]C+1"
ActiveCell.Value = z

But calling out a formula in a variable definition seems to be a problem...

Thanks again....

rick_deacha
04-11-2006, 01:02 PM
Dim z As Integer

z = Activecell.offset(-1,0).value + 1
ActiveCell.Value = zShould do the trick, or just ActiveCell.Value = Activecell.offset(-1,0).value + 1

zx12r
04-11-2006, 02:22 PM
Perfect! Thanks! :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum