![]() |
Looped process
I have four arrays of variables in Sheet2 (A1:A10),
(B1:B10), (C1:C10), and (D1:D10). I would like to copy cell A1 (from Sheet2) to Sheet1 cell B2, cell B1 (from Sheet2) to Sheet1 cell B3, cell C1 (from Sheet2) to Sheet1 cell B4, and cell D1 (from Sheet2) to Sheet1 cell B5. After having copied-in these 4 values, the macro needs to record the value in Sheet1 cell B8 (which has been calculated based on a model with the values in cells B2:B5 as variables) and copy the result to Sheet2 cell E1, before repeating the process starting with row 2 in Sheet2, and repeat this process through row 10. I hope this makes sense, and I really appreciate any help I can get in solving this problem using a macro/VBA. |
Looped process
Sub Tester13()
Dim cell As Range For Each cell In Worksheets("Sheet2") _ .Range("A1:A10") cell.Resize(1, 4).Copy With Worksheets("sheet1") .Range("B1").PasteSpecial Transpose:=True cell.Offset(0, 4).Value = .Range("B8").Value End With Next End Sub Worked for me. -- Regards, Tom Ogilvy Henrik wrote in message ... I have four arrays of variables in Sheet2 (A1:A10), (B1:B10), (C1:C10), and (D1:D10). I would like to copy cell A1 (from Sheet2) to Sheet1 cell B2, cell B1 (from Sheet2) to Sheet1 cell B3, cell C1 (from Sheet2) to Sheet1 cell B4, and cell D1 (from Sheet2) to Sheet1 cell B5. After having copied-in these 4 values, the macro needs to record the value in Sheet1 cell B8 (which has been calculated based on a model with the values in cells B2:B5 as variables) and copy the result to Sheet2 cell E1, before repeating the process starting with row 2 in Sheet2, and repeat this process through row 10. I hope this makes sense, and I really appreciate any help I can get in solving this problem using a macro/VBA. |
All times are GMT +1. The time now is 06:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com