Friday 12 April 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...