Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Borders to every 8-th row

Hi , and a good day to all programmers

I need to have a macro to put in a range ,
( for example Range A1 : E 1000 ) , to every
8-th row , borders , like this :

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

A lot of thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Borders to every 8-th row

Try this (just set the range, and frequency to your actual values)...

Sub BordersEvery8Rows()
Dim X As Long, R As Range, Freq As Long
Freq = 8
Set R = Range("A1:E30")
For X = Freq To R.Rows.Count Step 8
With R(1).Offset(X - 1).Resize(1,R.Columns.Count).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next
End Sub

--
Rick (MVP - Excel)



"ytayta555" wrote in message
...
Hi , and a good day to all programmers

I need to have a macro to put in a range ,
( for example Range A1 : E 1000 ) , to every
8-th row , borders , like this :

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

A lot of thanks in advance


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Borders to every 8-th row

On 21 apr., 17:19, ytayta555 wrote:
Hi , and a good day to all programmers


Hi again . I have found myself this code from an Rick old post , work
excellent :

Sub BORDEREVERYTNHRow()

Dim RowNum As Integer
RowNum = InputBox("Ever what row would you like colored ???")
For i = 0 To 1000 Step RowNum
With ActiveSheet
..Range("A1:E1").Offset(i, 0).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
Next i

End Sub

Thanks . A good year everybody .
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Borders to every 8-th row

On 21 apr., 17:51, "Rick Rothstein"
wrote:
Try this (just set the range, and frequency to your actual values)...


Thank you very much , I tested it and work well too .
Have a good year .
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
Borders Derek Koehler Excel Discussion (Misc queries) 1 March 12th 09 02:19 PM
Borders Liz Excel Programming 4 July 3rd 07 12:58 PM
borders Brush Prairie Excel Discussion (Misc queries) 0 August 23rd 05 02:57 AM
Borders Alan Excel Programming 3 November 10th 04 06:40 PM
Help with borders Ed[_10_] Excel Programming 0 July 23rd 03 08:07 PM


All times are GMT +1. The time now is 01:23 PM.

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"