Consulting

Results 1 to 3 of 3

Thread: Solved: Dynamic Range

  1. #1
    VBAX Regular
    Joined
    Aug 2008
    Posts
    7
    Location

    Question Solved: Dynamic Range

    I want to define a dynamic range. The following code gives the message:
    Run-time error '438':
    Object doesn't support this property or method
    Any help would be appreciated! Thanks
    [IMG]file:///C:/DOCUME%7E1/rgfinch/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG][IMG]file:///C:/DOCUME%7E1/rgfinch/LOCALS%7E1/Temp/moz-screenshot-1.jpg[/IMG]
    [IMG]file:///C:/DOCUME%7E1/rgfinch/LOCALS%7E1/Temp/moz-screenshot-2.jpg[/IMG]Sub highlight090208()

    colkount = Application.CountA(Range("1:1"))
    MsgBox (colkount)

    rowkount = Application.CountA(Range("A:A"))
    MsgBox (rowkount)

    mydata = Application.Offset("A1", 0, 0, rowkount, colkount)
    Range("mydata").Select

    End Sub

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Try
    Set myData = Range("A1").Resize(rowkount,colkount)

  3. #3
    VBAX Regular
    Joined
    Aug 2008
    Posts
    7
    Location
    Thanks very much!

Posting Permissions

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