Hello everyone
What I want to do is copy a list of values from one sheet to another ( range("b2:b52901")) but I want to add a value to it depending on the value from a for..next function
ex
x=0 x=1 x=2
sheet1 sheet2 sheet3
1 2 3
2 3 4
4 5 6
1 2 3
What I have tried so far is
ActiveCell.Formula = ThisWorkbook.Worksheets("ORIGINAL DATA").Cells(2, 2).Formula + X
and then an autofill. but this only copies the value from cell b2 through the range. I can see that my code is stuck looking at b2 though but dont know how to make it more dynamic. I could try
for y = 1 to no.of rows
activecell.offset(1,0).select
ActiveCell.Formula = ThisWorkbook.Worksheets("ORIGINAL DATA").Cells(2+y, 2).Formula + X
next y
but I can't help thinking that this will take a long time considering the number of rows and the number of sheets the macro will be creating
Any suggestions?
Thanks
Andrew299
It may have hit every branch on its way out of the ugly tree, but hey! It works. (but don't quote me on that)
What I want to do is copy a list of values from one sheet to another ( range("b2:b52901")) but I want to add a value to it depending on the value from a for..next function
ex
x=0 x=1 x=2
sheet1 sheet2 sheet3
1 2 3
2 3 4
4 5 6
1 2 3
What I have tried so far is
ActiveCell.Formula = ThisWorkbook.Worksheets("ORIGINAL DATA").Cells(2, 2).Formula + X
and then an autofill. but this only copies the value from cell b2 through the range. I can see that my code is stuck looking at b2 though but dont know how to make it more dynamic. I could try
for y = 1 to no.of rows
activecell.offset(1,0).select
ActiveCell.Formula = ThisWorkbook.Worksheets("ORIGINAL DATA").Cells(2+y, 2).Formula + X
next y
but I can't help thinking that this will take a long time considering the number of rows and the number of sheets the macro will be creating
Any suggestions?
Thanks
Andrew299
It may have hit every branch on its way out of the ugly tree, but hey! It works. (but don't quote me on that)