ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Property Set (https://www.excelbanter.com/excel-programming/290284-re-property-set.html)

Bob Phillips[_6_]

Property Set
 
Peter,

There is an error in the code, which when corrected seems to sort it (oddly
enough)

This code

Public Property Get CellRange() As Range
Set cellRangte = rangeP
End Property

should be

Public Property Get CellRange() As Range
Set cellRange = rangeP
End Property

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Peter" wrote in message
...
I created a class as below:
Private rangeP As Range
Public Property Get CellRange() As Range
Set cellRangte = rangeP
End Property
Public Property Set CellRange(ByVal p_Range As Range)
Set rangeP = p_Range
End Property
But, I have difficult to use it, my code is as below. Please advise.
Sub Button1_Click()
Dim myCell As clsCell ' declare the class
Set myCell = New clsCell ' create a object
With myCell
Set .CellRange = Range("Sheet1!A1:B10")

'assignment reuslt is Nothing, Wrong!!!
End With
End Sub

Peter





All times are GMT +1. The time now is 10:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com