Results 1 to 5 of 5

dim not working on multiple ranges

Threaded View

  1. #1
    Registered User
    Join Date
    03-18-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    1

    dim not working on multiple ranges

    I must be doing something basic wrong.

    Sub sbTestRanges()
    Dim a, b, c As Range
        a = Cells(1, 1)
        b = Cells(1, 1)
        c = Cells(1, 1)
    End Sub
    I get an error only for c, that the object variable or with block variable is not set.

    if I change the dim line to
    dim a, b, c, d as range and never use variable d, then the macro runs as I expect with no errors.

    Can anyone explain? Visual Basic 6.5 in Excel 2003.
    Last edited by royUK; 03-18-2010 at 03:06 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