ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   in Excel, how to put gridline every ten rows (https://www.excelbanter.com/excel-worksheet-functions/117057-excel-how-put-gridline-every-ten-rows.html)

badfastfan

in Excel, how to put gridline every ten rows
 
How can I set up the procedure (formatting, macro, whatever) to place a
gridline every ten rows on my spreadsheets? Or, how can I get it to put a
gridline at every TOTAL line, when I apply subtotals? I have EXCEL 97.

Don Guillett

in Excel, how to put gridline every ten rows
 
try this?
Sub insertline()
For Each c In Range("a2:a100")
If UCase(c) = "TOTAL" Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub

--
Don Guillett
SalesAid Software

"badfastfan" wrote in message
...
How can I set up the procedure (formatting, macro, whatever) to place a
gridline every ten rows on my spreadsheets? Or, how can I get it to put a
gridline at every TOTAL line, when I apply subtotals? I have EXCEL 97.




badfastfan

in Excel, how to put gridline every ten rows
 
I could not get what you sent to work, but that is probalby me rather than
Excel. So I asked a couple others at work to look at it. After a few
versions based on what you gave me, this is what we came up with to put a
line every ten rows.

Sub insertline()
Dim x As Long
For Each c In Rows
x = x + 1
If x Mod 10 = 0 Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub

Thank you so much.


"Don Guillett" wrote:

try this?
Sub insertline()
For Each c In Range("a2:a100")
If UCase(c) = "TOTAL" Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub

--
Don Guillett
SalesAid Software

"badfastfan" wrote in message
...
How can I set up the procedure (formatting, macro, whatever) to place a
gridline every ten rows on my spreadsheets? Or, how can I get it to put a
gridline at every TOTAL line, when I apply subtotals? I have EXCEL 97.





Don Guillett

in Excel, how to put gridline every ten rows
 

What I sent was tested for any cell in col A that said Total or TOTAL or
total.
What you sent will put a line every 10 rows to the bottom of the workbook
causing BLOAT. BAD!!
--
Don Guillett
SalesAid Software

"badfastfan" wrote in message
...
I could not get what you sent to work, but that is probalby me rather than
Excel. So I asked a couple others at work to look at it. After a few
versions based on what you gave me, this is what we came up with to put a
line every ten rows.

Sub insertline()
Dim x As Long
For Each c In Rows
x = x + 1
If x Mod 10 = 0 Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub

Thank you so much.


"Don Guillett" wrote:

try this?
Sub insertline()
For Each c In Range("a2:a100")
If UCase(c) = "TOTAL" Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub

--
Don Guillett
SalesAid Software

"badfastfan" wrote in message
...
How can I set up the procedure (formatting, macro, whatever) to place a
gridline every ten rows on my spreadsheets? Or, how can I get it to
put a
gridline at every TOTAL line, when I apply subtotals? I have EXCEL 97.







badfastfan

in Excel, how to put gridline every ten rows
 
Yes it did exactly that. But I can deal with that, some of my spreadsheets
are over 35000 rows, so it is ok. And it does put the gridline across the
entire line, rather than in just one column. So all is well. Again thank
you for your help.

"Don Guillett" wrote:


What I sent was tested for any cell in col A that said Total or TOTAL or
total.
What you sent will put a line every 10 rows to the bottom of the workbook
causing BLOAT. BAD!!
--
Don Guillett
SalesAid Software

"badfastfan" wrote in message
...
I could not get what you sent to work, but that is probalby me rather than
Excel. So I asked a couple others at work to look at it. After a few
versions based on what you gave me, this is what we came up with to put a
line every ten rows.

Sub insertline()
Dim x As Long
For Each c In Rows
x = x + 1
If x Mod 10 = 0 Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub

Thank you so much.


"Don Guillett" wrote:

try this?
Sub insertline()
For Each c In Range("a2:a100")
If UCase(c) = "TOTAL" Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub

--
Don Guillett
SalesAid Software

"badfastfan" wrote in message
...
How can I set up the procedure (formatting, macro, whatever) to place a
gridline every ten rows on my spreadsheets? Or, how can I get it to
put a
gridline at every TOTAL line, when I apply subtotals? I have EXCEL 97.







Don Guillett

in Excel, how to put gridline every ten rows
 
glad you are happy

--
Don Guillett
SalesAid Software

"badfastfan" wrote in message
...
Yes it did exactly that. But I can deal with that, some of my
spreadsheets
are over 35000 rows, so it is ok. And it does put the gridline across the
entire line, rather than in just one column. So all is well. Again thank
you for your help.

"Don Guillett" wrote:


What I sent was tested for any cell in col A that said Total or TOTAL or
total.
What you sent will put a line every 10 rows to the bottom of the workbook
causing BLOAT. BAD!!
--
Don Guillett
SalesAid Software

"badfastfan" wrote in message
...
I could not get what you sent to work, but that is probalby me rather
than
Excel. So I asked a couple others at work to look at it. After a few
versions based on what you gave me, this is what we came up with to put
a
line every ten rows.

Sub insertline()
Dim x As Long
For Each c In Rows
x = x + 1
If x Mod 10 = 0 Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub

Thank you so much.


"Don Guillett" wrote:

try this?
Sub insertline()
For Each c In Range("a2:a100")
If UCase(c) = "TOTAL" Then
With c.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next c
End Sub

--
Don Guillett
SalesAid Software

"badfastfan" wrote in message
...
How can I set up the procedure (formatting, macro, whatever) to
place a
gridline every ten rows on my spreadsheets? Or, how can I get it to
put a
gridline at every TOTAL line, when I apply subtotals? I have EXCEL
97.









Debra Dalgleish

in Excel, how to put gridline every ten rows
 
You could add the gridlines with conditional formatting:

Turn off the gridlines (ToolsOptions, View tab)
Select all the cells on the worksheet
Choose FormatConditional Formatting
From the first dropdown, choose Formula Is
In the formula box, type: =MOD(ROW(),10)=0
Click the Format button
On the Borders tab, add a light grey bottom border
Click OK, click OK

badfastfan wrote:
How can I set up the procedure (formatting, macro, whatever) to place a
gridline every ten rows on my spreadsheets? Or, how can I get it to put a
gridline at every TOTAL line, when I apply subtotals? I have EXCEL 97.



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


Don Guillett

in Excel, how to put gridline every ten rows
 
Debra, As usual, a great solution without creating file bloat.

--
Don Guillett
SalesAid Software

"Debra Dalgleish" wrote in message
...
You could add the gridlines with conditional formatting:

Turn off the gridlines (ToolsOptions, View tab)
Select all the cells on the worksheet
Choose FormatConditional Formatting
From the first dropdown, choose Formula Is
In the formula box, type: =MOD(ROW(),10)=0
Click the Format button
On the Borders tab, add a light grey bottom border
Click OK, click OK

badfastfan wrote:
How can I set up the procedure (formatting, macro, whatever) to place a
gridline every ten rows on my spreadsheets? Or, how can I get it to put
a gridline at every TOTAL line, when I apply subtotals? I have EXCEL 97.



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html




Debra Dalgleish

in Excel, how to put gridline every ten rows
 
Thanks Don!

Don Guillett wrote:
Debra, As usual, a great solution without creating file bloat.



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 09:22 AM.

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