ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy across formula while skipping columns (https://www.excelbanter.com/excel-programming/424118-copy-across-formula-while-skipping-columns.html)

Joshua

copy across formula while skipping columns
 
I'm trying to write a macro that will:

1) select a range of cells within the same row - where the first cell
in the range contains a formula with a link to another cell

2)macro copies the formula from the first cell in the range and pastes
it into the remaining cells in the selected range, while skipping a
user defined number of columns

before macro:

A B C D E F G
1 10
2
3 10 20 30 40

after macro:

A B C D E F G
1 10 20 30 40
2
3 10 20 30 40

the formula in A1 is =A3. I'd like to be able to select A1:G1 and run
the macro so that C1 refers to B3, E1 refers to C3, etc. I'd like
this to also work where the formula contains a combination of one or
more links and/or arithmetic operations. Would be awesome if this
could also work vice-a-versa.

Thanks in advance for your help on this. I have absolutely no idea
how to write this kind of thing, please help! I've made my question
MUCH more concise so it should be clear now = )

mdmackillop[_28_]

copy across formula while skipping columns
 

Can you post a workbook with Before/After with formulae inserted. I
can't follow this from your question. You say C1 refers to B3 but show
C1 = 20, B3 = 10.

Are you really working with such simple formulae?

Vice-Versa? This means nothing to me. You can't enter in C1 "=B3" and
in B3 "=C1" for obvious reasons.


--
mdmackillop
------------------------------------------------------------------------
mdmackillop's Profile: http://www.thecodecage.com/forumz/member.php?userid=113
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=64347



All times are GMT +1. The time now is 10:37 AM.

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