Results 1 to 4 of 4

Macro taking a lot of time

Threaded View

  1. #1
    Registered User
    Join Date
    02-10-2011
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    2

    Macro taking a lot of time

    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
    Last edited by anumolud; 02-10-2011 at 07:24 AM. Reason: add code tags for newbie PM OP warning

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1