View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Greg Snidow Greg Snidow is offline
external usenet poster
 
Posts: 153
Default Rows added after refresh not in formula

Thanks Duke, but I am confused. Are you saying that something would be
populated in column A? This is not what I need. Column A is a job# that
comes from the SQL view. What I need is for the formulas in certain columns,
G, in my example to exist in all rows in column G where there is a job# in A.
If that is what you are trying to tell me I do not understand. Does any of
this make sense? If not let me know, as I do not know the lingo you all use
to get my point across.



"Duke Carey" wrote:

Well, to address your question about copying the formula in a macro, you can
determine the last row of data by doing something like this

dim lrow as long
lrow = Range("c65256").End(xlUp).Row

and then this will populate column A, starting in row 6, with the =F6*$G$5
formula

Range("a6", "a" & lrow).FormulaR1C1 = "= rc6*r5c7"


"Greg Snidow" wrote:

Thanks Duke. I had it that way at first, but my boss asked me to change it.
He wants to be able to manipulate a total dollar amount for each column based
on a value placed in one cell. Since I am the only one here who works on the
server, and I certainly do not want users editing the view even if they had
access or know-how, it is best to do the calculations in Excel.

"Duke Carey" wrote:

Greg -

What about modifying your query to INCLUDE the formula? So...if you are
running a query like

Select
Product,
Price,
Quanitity
from
Inventory
order by
Price

and you want to multiply Price by a discout rate (whatever is in $G$5??) you
could use this query instead - and it would automatically fill in the REUSLTS
for you.

Select
Product,
Price,
Quanitity,
Price*Discount as NetPrice
from
Inventory
order by
Price


"Greg Snidow" wrote:

Greetings all. I know I saw the answer to this one recently, but I can not
find it now. I have a workbook with worksheets linked to SQL2K. I have many
formulas like =F6*$G$5. I drag the formula down to one row below the last
row of data on the sheet, and everything works as it should. The problem is
that when I refresh the data if any rows are added they are not included in
the formula, eventhough they are added above where I dragged the formula. Is
there an easy way to make any new rows be included in the formula? Thank
you.