ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Grid Line (https://www.excelbanter.com/excel-discussion-misc-queries/195984-grid-line.html)

Ravi

Grid Line
 
Hi,
While running a macro in a new worksheet for grid line an error occured and
while debugging " .LineStyle = xlContinuous "

Thanks in advance
Ravi Kumar

Don Guillett

Grid Line
 

Perhaps you could share more of the code.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ravi" wrote in message
...
Hi,
While running a macro in a new worksheet for grid line an error occured
and
while debugging " .LineStyle = xlContinuous "

Thanks in advance
Ravi Kumar



Ravi

Grid Line
 
here is the code

Sub line()
'
' line Macro
' Macro recorded 7/23/2008 by ravikumart
'
' Keyboard Shortcut: Ctrl+Shift+W
'
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub



"Don Guillett" wrote:


Perhaps you could share more of the code.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ravi" wrote in message
...
Hi,
While running a macro in a new worksheet for grid line an error occured
and
while debugging " .LineStyle = xlContinuous "

Thanks in advance
Ravi Kumar




Don Guillett

Grid Line
 
It appears you didn't have enough code doing it that way. Try this. If you
don't want the border around simply comment it out or remove the line.

Sub DoBorders()
With Selection
.Borders.LineStyle = xlContinuous
.BorderAround Weight:=xlMedium
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ravi" wrote in message
...
here is the code

Sub line()
'
' line Macro
' Macro recorded 7/23/2008 by ravikumart
'
' Keyboard Shortcut: Ctrl+Shift+W
'
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub



"Don Guillett" wrote:


Perhaps you could share more of the code.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ravi" wrote in message
...
Hi,
While running a macro in a new worksheet for grid line an error
occured
and
while debugging " .LineStyle = xlContinuous "

Thanks in advance
Ravi Kumar






All times are GMT +1. The time now is 10:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com