T
Tim
Using VBA 6.5, I receive the runtime error when running FormatQtrAnalysis.
I know it has to do something with the way I have set up the class
CSTIAnalysis.
Problem is I do not know what that something is.
Is there any suggestions as to what I am overlooking?
Any suggestions as to where to look at will be appreciated.
(Of course, an answer will Greatly Appreciated!)
Sub FormatQtrAnalysis()
Dim csaQtrAnalysis As CSTIAnalysis
Set csaQtrAnalysis = New CSTIAnalysis
csaQtrAnalysis.Worksheet = ActiveSheet
csaQtrAnalysis.FormatHeader 'When pressing Debug, this line is
highlighted
End Sub
Private pWorksheet As Worksheet
Public Property Get Worksheet() As Worksheet
Worksheet = pWorksheet
End Property
Public Property Let Worksheet(vNewValue As Worksheet)
Set pWorksheet = vNewValue
End Property
Public Sub FormatHeader()
Dim rHeader As Range
Dim iColCount As Integer
iColCount = pWorksheet.UsedRange.Columns.Count
rHeader = pWorksheet.Range(Cells(1, 1), Cells(1, iColCount))
rHeader.MergeCells = False
With rHeader
.Merge
.EntireRow.AutoFit
.BorderAround Weight:=xlThick, ColorIndex:=1
End With
End Sub
I know it has to do something with the way I have set up the class
CSTIAnalysis.
Problem is I do not know what that something is.
Is there any suggestions as to what I am overlooking?
Any suggestions as to where to look at will be appreciated.
(Of course, an answer will Greatly Appreciated!)
From STIOptions Module
Sub FormatQtrAnalysis()
Dim csaQtrAnalysis As CSTIAnalysis
Set csaQtrAnalysis = New CSTIAnalysis
csaQtrAnalysis.Worksheet = ActiveSheet
csaQtrAnalysis.FormatHeader 'When pressing Debug, this line is
highlighted
End Sub
From CSTIAnalysis Class
Private pWorksheet As Worksheet
Public Property Get Worksheet() As Worksheet
Worksheet = pWorksheet
End Property
Public Property Let Worksheet(vNewValue As Worksheet)
Set pWorksheet = vNewValue
End Property
Public Sub FormatHeader()
Dim rHeader As Range
Dim iColCount As Integer
iColCount = pWorksheet.UsedRange.Columns.Count
rHeader = pWorksheet.Range(Cells(1, 1), Cells(1, iColCount))
rHeader.MergeCells = False
With rHeader
.Merge
.EntireRow.AutoFit
.BorderAround Weight:=xlThick, ColorIndex:=1
End With
End Sub