Guys,
I have the following code that is taking a lot of time. I am a novice in vba and built this code with the help of Google. Please help me to optimize this.
Thanks.
Sub BSERealtyInflationReturns()
Dim RowCount As Integer
Dim RowCount1 As Integer
Dim ColumnCount As Integer
Sheets("BSERealtyIndexSheet2").Select
Range("C2").Select
Range("D1").Select
Selection.Value = 100
Selection.Offset(1, 0).Select
RowCount = Application.CountA(Range("A:A"))
RowCount1 = 0 - RowCount + 1
ColumnCount = 1
Do Until Selection.Offset(0, -3) = ""
Do Until Selection.Offset(0, -3) = ""
Selection.Value = Selection.Offset(-1, 0) * (Selection.Offset(0, -1 * ColumnCount) + 1) + 100
Selection.Offset(1, 0).Select
Loop
Selection.Offset(RowCount1, 1).Select
ColumnCount = ColumnCount + 1
RowCount1 = RowCount1 + 1
Loop
End Sub
Bookmarks