Friday, April 12, 2019

excel - VBA Copy and Paste random cells in a loop using VBA

I will like to Copy and Paste cells in one worksheet with VBA, to another sheet in VBA using a loop.



For example, I will like to copy cell A2 in sheet2 to cell A1 in sheet1, cell B2 in sheet2 to cell B1 in sheet1. Then A3 in sheet2 to cell A1 in sheet1, cell B3 to cell B1 in sheet1. I will like to do this until the last row.



I tried the code below, but my data set is too large. Is there another alternative method?



'Worksheets("Sheet1").Range("C28").Value = Worksheets("Sheet2").Range("B2").Value

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...