ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Anyone Well-versed in loop? (https://www.excelbanter.com/excel-programming/301529-anyone-well-versed-loop.html)

Matt G[_6_]

Anyone Well-versed in loop?
 
I am working in VB Editor trying to write a command that will get th
below commands to work in increments of four but have had no success.

The below is sample of the commands I wrote that take data from sheet
and copy it to sheet2 in my desired format.

It is essentially 1 line of data from sheet1 moving into four lines o
sheet2.


Range("C2").Select
ActiveCell.FormulaR1C1 = "=Entry!R[-0]C"
Range("C3").Select
ActiveCell.FormulaR1C1 = "=Entry!R[-1]C"
Range("C4").Select
ActiveCell.FormulaR1C1 = "=Entry!R[-2]C"
Range("C5").Select
ActiveCell.FormulaR1C1 = "=Entry!R[-3]C"
Range("C5").Select

Range("D2").Select
ActiveCell = 100
Range("D3").Select
ActiveCell = 110
Range("D4").Select
ActiveCell = 120
Range("D5").Select
ActiveCell = 130
Range("D5").Select

I am trying to find away to make these Row 3 numbers variable.


Any suggestions?
Mat

--
Message posted from http://www.ExcelForum.com



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

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