Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with code kk Excel Discussion (Misc queries) 0 March 15th 08 03:01 PM
XLS to CSV Code Problem carl Excel Worksheet Functions 0 March 28th 07 01:21 AM
Problem with Code --- Please help Les Stout[_2_] Excel Programming 11 October 17th 05 09:47 PM
Problem with code Steve[_71_] Excel Programming 2 December 12th 04 03:47 PM
Code Problem TC[_8_] Excel Programming 8 November 30th 04 07:09 PM


All times are GMT +1. The time now is 07:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"