Opmerking indicatie kleur wijzigen

Status
Niet open voor verdere reacties.

Tweety1

Gebruiker
Lid geworden
6 mrt 2013
Berichten
637
Via de website http://www.contextures.com/xlcomments03.html heb ik onderstaande 2 query gevonden en bewerkt alleen lukt het me niet om de query aan te passen zodat het op 2 cellen werkt.

Code:
Sub CoverCommentIndicator()
'www.contextures.com\xlcomments03.html
Dim ws As Worksheet
Dim cmt As Comment
Dim rngCmt As Range
Dim shpCmt As Shape
Dim shpW As Double 'shape width
Dim shpH As Double 'shape height
Set ws = ActiveSheet
shpW = 5
shpH = 5
On Error Resume Next
For Each cmt In ws.Comments
    'Set rngCmt = cmt.Parent
    [COLOR="#FF0000"]Set rngCmt = Range("A1:A2")[/COLOR]
        With rngCmt
        Set shpCmt = ws.Shapes.AddShape(msoShapeRightTriangle, _
                        rngCmt.Offset(0, 1).Left - shpW, .Top, shpW, shpH)
        End With
    With shpCmt[COLOR="#FF0000"][/COLOR]
        .Flip msoFlipVertical
        .Flip msoFlipHorizontal
        .Fill.ForeColor.RGB = RGB(192, 192, 192)
        .Fill.Visible = msoTrue
        .Fill.Solid
        .Line.Visible = msoFalse
    End With
Next cmt
End Sub

Code:
Sub RemoveIndicatorShapes()
'www.contextures.com\xlcomments03.html
Dim ws As Worksheet
Dim shp As Shape
Set ws = ActiveSheet
For Each shp In ws.Shapes
If Not shp.TopLeftCell.Comment Is Nothing Then
  If shp.AutoShapeType = _
    msoShapeRightTriangle Then
    shp.Delete
  End If
End If
Next shp
End Sub
 
Hoi,
plaats eens een vb bestandje met wat je exact wil bereiken, nu heb ik er geen flauw benul van.

mischien deze?
Code:
Set rngCmt = Range("A1:A2")
rngCmt.Columns(1).Select
Groet
 
Status
Niet open voor verdere reacties.

Nieuwste berichten

Terug
Bovenaan Onderaan