View Single Post
 
Old 08-25-2014, 01:49 PM
ue418 ue418 is offline Windows 7 32bit Office 2000
Novice
 
Join Date: May 2012
Posts: 17
ue418 is on a distinguished road
Default specifying a cell value from another cell and a constant

I've assumed this was working just fine for many months. The VBA code is used in conjunction with Excel Solver, but that shouldn't be important for this question. To specify the value of, say, cell "Ai", where "i" is a positive integer, I have:

ActiveSheet.Range("$A$" & i).Value = "$R$42" & "-140.5"

It suddenly appears that this is NOT giving me what I thought it was...a numerical value. BTW, cell R42 is currently = 209. So I thought this expression was setting cell "Ai" to 68.5. But now, it appears that it is simply an expression, perhaps a string or variant. This sounds ridiculously simple, but can someone please tell me how to specify a numerical cell value, in VBA, as the sum of another cell value and a constant? Thanks a lot, ahead of time!
Reply With Quote