View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default problem with code

Hi,

Try it this way:


Range("U" & (zeile + 2) & ":V" & (zeile + 6)).Select


--
Hope that helps.

Vergel Adriano


"MicrosoftNews" wrote:



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