Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro problem in 2003 (2003)

    I just changed from Excel 2000 to Excel 2003. I have a macro (see below) that worked fine in 2000 and now I get an error - Invalid outside procedure. It highlights (Active Cell)

    Dim lngRowOffset As Long
    Dim rng As Range
    If IsEmpty(ActiveCell) Then
    Range("A1").Select
    Exit Sub
    End If
    Set rng = Range(ActiveCell, ActiveCell.End(xlToRight))
    lngCols = rng.Columns.Count
    Do
    With rng.Interior
    .ColorIndex = 36
    .Pattern = xlSolid
    End With
    Set rng = rng.Offset(2, 0)
    Loop Until Not FilledRange(rng)
    End Sub

    Function FilledRange(rng As Range) As Boolean
    Dim ocell As Range
    For Each ocell In rng.Cells
    If Not IsEmpty(ocell) Then
    FilledRange = True
    Exit Function
    End If
    Next ocell
    End Function

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro problem in 2003 (2003)

    There is no Sub ... or Function ... at the beginning of your code. In this form it wouldn't be valid in any version of Excel. Did you omit one or more lines?

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro problem in 2003 (2003)

    I just got a new version of Excel and I copied all my macros to a Word document and now I am trying to restore them. I probably missed something when I copied this macro.

Posting Permissions

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