Request for Help! (1 Viewer)

psimpson

Registered User.
Local time
Today, 10:38
Joined
Aug 1, 2007
Messages
40
Hello. I want to work with the value that a cell address located in a cell corresponds to; and I want to use it in a calculation (=sum(x+y)). Is there a way to convert the cell (say D3) to its value (say 50) and add it to get an aggregate number?

Any help is appreciated.

Thanks.
 

June7

AWF VIP
Local time
Today, 09:38
Joined
Mar 9, 2014
Messages
5,492
Not understanding question. Why can't you just reference cell D3?
 

psimpson

Registered User.
Local time
Today, 10:38
Joined
Aug 1, 2007
Messages
40
I must concatenate the cell location from other data. Once I have the correct cell location, I want to use it in a sum function, but my function adds to the cell location instead of the contents. For example, D1, plus 20 becomes D21. Instead, I want 50, plus 20 to equate to 70.
 

June7

AWF VIP
Local time
Today, 09:38
Joined
Mar 9, 2014
Messages
5,492
What "sum function" - is this VBA code? Provide your code. If you want to provide workbook for analysis, follow instructions at bottom of my post.
 

sxschech

Registered User.
Local time
Today, 10:38
Joined
Mar 2, 2010
Messages
799
Here are a couple of examples if concatenating in VBA

1st gets the sum of D2 through D and a variable defined as cellrow. Using your post of cell being D3, cellrow =3 then it would equate out to Sum D2 through D3
The rest are putting a formula into a specific cell on the spreadsheet

Code:
stsum = "=Sum(D2:D" & cellrow & ")"

.Range("D" & cellrow + 2).Formula = "=Sum(D2:D" & cellrow & ")"
.Range("D" & cellrow + 4).Formula = "=D" & cellrow + 2 & "-D" & cellrow + 3 & ""

Otherwise maybe if you are looking at putting a formula in a cell and not using vba, perhaps the Indirect Function would help?
 

Users who are viewing this thread

Top Bottom