Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with code
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with code
Try:
Range("U" & zeile + 2 & ":V" & zeile + 6).Select In article , "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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem with code
Thanks very much :-) you're great
"MicrosoftNews" schrieb im Newsbeitrag ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem with code | Excel Discussion (Misc queries) | |||
XLS to CSV Code Problem | Excel Worksheet Functions | |||
Problem with Code --- Please help | Excel Programming | |||
Problem with code | Excel Programming | |||
Code Problem | Excel Programming |