Skip,
Thanks for the tip. That may be a good alternative. I guess I should abandon using Named references that are relative. It seems they don't work in VBA. Do you agree?
SKIP - "How would it return an error? "
If I use the Cells command with a specific Column Number, then if a column is inserted into the spreadsheet, then won't the Cells command not be updated and therefore reference the wrong cell?
SKIP - "AVOID the Select and Activate methods as much as...
Guys,
One other thing. Although Skip's method, ie, using Cells works, I'd rather not use it, since it could result in an error if a Column is inserted in the spreadsheet. I'd rather use relative references, so the VBA code works even if the spreadsheet is modified...
Thanks guys for the reply and assistance. Hopefully this will help you folks understand the problem better.
COMBO: "When you define/view it, the address is relative to active cell. The same is in vba, to take the full advantage you need to change selection while looping."
I tried this, but...
This is what the spreadsheet currently does:
The current spreadsheet is for structural calculations. Both input items and calcuated cells are done in the same row. This allows doing the same calc with different inputs simply by copying the row over and over. The calcs refer to both inputs...
Skip,
I am using Excel 2007. And Yes SD is a named range. Again, works fine if absolute, but defaults to Row 1 if relative.
Not sure how to paste in the Named Ranges, but
SD refers to Calcs!$r$3
AWR refers to Calcs!$AO11
Thanks again!
AreaWR = Range("Ao39") 'WORKS
AreaWR = Range("SD") 'Works
AreaWR = Range("AWR") 'Works only on Line 1
Thanks for the reply. The first and second works fine. The difference is that the first one use relative reference while the second absolute.
The third one seems to select the right...
*** Newbie Warning ***
I have an application that uses Named Variables with relative references. In other words, I use a rows to do computations that reference other columns in the row for values. The value in these cells changes depending on which row it is being calculated in.
I want to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.