ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Move to next row (https://www.excelbanter.com/excel-discussion-misc-queries/214123-move-next-row.html)

Unique713

Move to next row
 
Is there any way to to change this macro so that every time it is run the row
is changed? Here is the macro:

Range("C1").Select
ActiveCell.FormulaR1C1 = "=Master!R[3]C"

When this is run the next time i want the 3 to be a 4. And then the next
time I want the 4 to be a 5. Is this possible?

Luke M

Move to next row
 
You could use a helper cell.
something like

Dim xCount as Integer
xCount = Range("A1").value 'where A1 has initially been set to 3
Range("C1").Select
ActiveCell.FormulaR1C1 = "=Master!R["&xCount&"]C"
Range("A1").value = Range("A1").value + 1

Of course, you could use any cell, on any sheet you want as a helper cell.

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Unique713" wrote:

Is there any way to to change this macro so that every time it is run the row
is changed? Here is the macro:

Range("C1").Select
ActiveCell.FormulaR1C1 = "=Master!R[3]C"

When this is run the next time i want the 3 to be a 4. And then the next
time I want the 4 to be a 5. Is this possible?


Unique713

Move to next row
 
I am very new to macros so I am a little confused. Where you put the x would
be the number of rows I want it to move everytime the macro is run? Does the
"A1" range value equal the cell that i want the information placed in? With
the value portion on the bottom, wont that just add to the figure in the cell
(if the value of the cell is 4 wont it make it 5)?

"Luke M" wrote:

You could use a helper cell.
something like

Dim xCount as Integer
xCount = Range("A1").value 'where A1 has initially been set to 3
Range("C1").Select
ActiveCell.FormulaR1C1 = "=Master!R["&xCount&"]C"
Range("A1").value = Range("A1").value + 1

Of course, you could use any cell, on any sheet you want as a helper cell.

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Unique713" wrote:

Is there any way to to change this macro so that every time it is run the row
is changed? Here is the macro:

Range("C1").Select
ActiveCell.FormulaR1C1 = "=Master!R[3]C"

When this is run the next time i want the 3 to be a 4. And then the next
time I want the 4 to be a 5. Is this possible?



All times are GMT +1. The time now is 10:22 PM.

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