Results 1 to 9 of 9

VBA doesn't copy the AVERAGE

Threaded View

  1. #1
    Registered User
    Join Date
    03-13-2010
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2010 Beta
    Posts
    13

    Question VBA doesn't copy the AVERAGE

    Sub EnterFormula()
        Worksheets("Sheet1").Range("M65").Formula = "=AVERAGE(M6:M47)"
        Range("M66").Copy Range("M67")    'On Deck becomes Prior Data
        Range("M65").Copy Range("M66")     'New data copied to On Deck area
    End Sub
    Private Sub Worksheet_Change(ByVal Target As Range)
        If Not Intersect(Target, Range("B6:B47")) Is Nothing Then
            Application.EnableEvents = False
            Range("K6:K47").Copy Range("L6:L47")    'On Deck becomes Prior Data
            Range("B6:B47").Copy Range("K6:K47")     'New data copied to On Deck area
            Application.EnableEvents = True
            End If
    End Sub
    I am good with the second section. It copies the old and new values to the ranged cells. But the first section doesn't work. Neither it is taking the average, nor copying the new value to M66 and old value to M67.

    What am I doing wrong?!?!
    Last edited by Litstone; 03-18-2010 at 12:59 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