problem with code

M

MicrosoftNews

Hi all,

I've got a problem in the following code which should create line around
some cells.

There is another part of code which fills a summary under a data sheet.

##########
Sub Rahmen_ziehen()

Dim zeile As Long

zeile = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row

Range("U & zeile + 2:V & zeile + 6").Select
'----> here is the problem !!!!!!!!!!!!

Range("V" & zeile + 6).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

End Sub
#############################################

But I don't know what's wrong. Can anybody help ?

greetings achim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top