close

All of my macros to date are for formatting, so I'm running into a bit of a
problem for a formula macro. I tend to use this formula often when using
pivot tables, as I need the left most column of the pivot table to poplulate
on every row. For example, the pivot table will result the following:

John Green 2
Red 3
Brown 4
Julie Green 1
Red 2
Brown 3

I really need it to list the names on each row. So I tend to copy the table
and paste it as a value, then use the following formula in the immediate
column to the left of the table data to populate:

=IF(G22=quot;quot;,IF(F21=quot;quot;,G21,F21),G22)

Of course this must be relative to the copied cells position. How can I
write the macro for this and still keep the cell referencing correct?

Any help is much appreciated. Thanks!Nevermind....I figured it out.

quot;Coreyquot; wrote:

gt; All of my macros to date are for formatting, so I'm running into a bit of a
gt; problem for a formula macro. I tend to use this formula often when using
gt; pivot tables, as I need the left most column of the pivot table to poplulate
gt; on every row. For example, the pivot table will result the following:
gt;
gt; John Green 2
gt; Red 3
gt; Brown 4
gt; Julie Green 1
gt; Red 2
gt; Brown 3
gt;
gt; I really need it to list the names on each row. So I tend to copy the table
gt; and paste it as a value, then use the following formula in the immediate
gt; column to the left of the table data to populate:
gt;
gt; =IF(G22=quot;quot;,IF(F21=quot;quot;,G21,F21),G22)
gt;
gt; Of course this must be relative to the copied cells position. How can I
gt; write the macro for this and still keep the cell referencing correct?
gt;
gt; Any help is much appreciated. Thanks!
gt;
gt;
gt;
gt;

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()