|
| ||||||||||
| Tags: cells color, error 438 |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Problem with cells color VB
I have a table with changing length of the rows and columns and sums at the end of each row/table/diagonal. I want to put some color to the table, but I get error 438 - Object doesn't support this property or method. Here is the code I have: Code: Sub ColorSet()
Dim cLL As Range, Rg As Range
Application.ScreenUpdating = False
For Each cLL In Range("A1:P10")
If IsEmpty(cLL) Then
With cLL.Interior
.ColorIndex = 0
.Pattern = xlSolid
End With
Else
With cLL.Interior
.ColorIndex = 3
.Pattern = xlSolid
.LineStyle = xlContinuous
End With
End If
Next cLL
Application.ScreenUpdating = True
End Sub |
|
#2
| ||||
| ||||
| Re: Problem with cells color VB
Microsoft has confirmed this to be a bug in the Microsoft products. There are two possible workarounds for this problem. - Access the form directly rather than by a variable containing the form. OR - Create property procedures in the form's code to provide access to the properties of the controls on the form. |
|
#3
| |||
| |||
| Re: Problem with cells color VB
Could you explain the worarounds in more details? |
|
#4
| |||
| |||
| Re: Problem with cells color VB
Which version of VB are you using... I have run into all kinds of errors in VB.net 2008. One big problem was the way it colors things instead of putting x .background.color.RED . some other property . some other property i had to type the item lets say x.background.color.RED x.some other property x. some other property |
|
#5
| |||
| |||
| Re: Problem with cells color VB
The version is Microsoft Visual Basic 6.5 So do I understand right that you mean putting it this way? Code: Sub ColorSet()
Dim cLL As Range, Rg As Range
'Set Rg = Range("A1:P10")
Application.ScreenUpdating = False
For Each cLL In Range("A1:P10")
If IsEmpty(cLL) Then
cLL.Interior.ColorIndex = 0
cLL.Interior.Pattern = xlSolid
Else
cLL.Interior.ColorIndex = 3
cLL.Interior.Pattern = xlSolid
cLL.Interior.LineStyle = xlContinuous
End If
Next cLL
Application.ScreenUpdating = True
End Sub |
|
#6
| |||
| |||
| Re: Problem with cells color VB
no that only works in vb.net--- I threw that out there in case you were using VB.net |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Problem with cells color VB" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Not able to change font color in some cells of Microsoft Excel | Garsen's | MS Office Support | 2 | 01-02-2012 01:08 PM |
| how can i highlight cells with color, which contain duplicates form a separate excel sheet | guigey | Windows Software | 3 | 01-06-2010 04:31 AM |
| Problem with color attribute in CSS | Carey | Software Development | 5 | 14-01-2010 12:20 AM |
| Problem to combine the values of cells in the order | windows_user | Software Development | 4 | 16-04-2009 11:35 PM |
| Problem with color pictures. | Dietrich | Monitor & Video Cards | 3 | 17-02-2009 09:45 AM |