Results 1 to 19 of 19

Can this VBA be simplified

Threaded View

  1. #16
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Can this VBA be simplified

    hi there, the code inbetween the following two lines:

    Application.EnableEvents = False
    ......
    Application.EnableEvents = True
    can be replaced with the following:

    ReDim arr(1 To 1, 1 To 34)
    
    rcounter = 1
    
    For i = Sheets("Sheet2").Index To Sheets.Count
        ccounter = 6
        For n = 1 To 34 Step 5
            rcounter = rcounter + 1
            ccounter = ccounter - 5
            arr(1, n) = "=DATE!R[" & rcounter & "]C[" & ccounter & "]"
        Next
        Sheets(i).Range("c1:aj1") = arr
    Next
    Last edited by watersev; 12-26-2012 at 06:41 PM.

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