excel vba - VBA - Storing a range into a Range Property on a user class -


i have class has following definition:

private pvtrngtest1 range  public property rngtest1() range     set rngtest1 = pvtrngtest end property  public property set rngtest1(byval rng range)     set pvtrngtest1 = rng end property 

when i'm using class, i'm trying:

sub findalltablesonsheet(osh worksheet)     dim olo listobject     each olo in osh.listobjects         msgbox "table found: " & olo.name & ", " & olo.range.address         dim sr sheetranges         set sr = new sheetranges                     set sr.rngtest1 = olo.range                     msgbox sr.rngtest1.address     next end sub 

i error: object required (on last line within next statement)

can please explain? believe i'm setting range property correctly, no error when set it, cannot access address of property.

as https://stackoverflow.com/users/3598756/user3598756 said above, typo. been 10 years since looked @ vba , overlooked benefits of option explicit. :s


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -