ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   How to set up reference to allow dragging (https://www.excelbanter.com/new-users-excel/12570-how-set-up-reference-allow-dragging.html)

mr unreliable

How to set up reference to allow dragging
 
hi Group,

I have a formula that looks something like this:

= CalcDiscount(ItemsSold FY2002)

(where "CalcDiscount" is a macro function)

I would like to be able to drag that formula across the row
to fill in the remaining cells (for 2004, 2005, etc)

But when I drag it, I get the SAME formula.

Is there any way to set up the formula so that when one
drags it, one would get:

CalcDiscount(ItemsSold FY2003),
CalcDiscount(ItemsSold FY2004), etc.

Note that when the formula is just "= ItemsSold", and you
drag that, you do get the ItemsSold in the column just
above, in other words, the column reference changes
(implicitly) to reflect the column where the formula is.

In the situation above, I had initially tried this:

= CalcDiscount(ItemsSold)

hoping that the column reference would be implicit.
However, the function rejected that parameter, because
"ItemsSold" was defined as a (row) array, and the parameter
expected was a cell.value reference. So, I had to add the
column name.

tiafah, jw




All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com