PC Review


Reply
Thread Tools Rate Thread

Borders to every 8-th row

 
 
ytayta555
Guest
Posts: n/a
 
      21st Apr 2010
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
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      21st Apr 2010
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" <(E-Mail Removed)> wrote in message
news:b143966d-e47b-4b3f-b435-(E-Mail Removed)...
> 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


 
Reply With Quote
 
ytayta555
Guest
Posts: n/a
 
      21st Apr 2010
On 21 apr., 17:19, ytayta555 <wherewindsm...@gmail.com> 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 .
 
Reply With Quote
 
ytayta555
Guest
Posts: n/a
 
      21st Apr 2010
On 21 apr., 17:51, "Rick Rothstein"
<rick.newsNO.S...@NO.SPAMverizon.net> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
lines & colored table borders, shared borders, thumbnails Jan Microsoft Frontpage 2 30th Mar 2008 07:13 PM
Borders =?Utf-8?B?QmlsbCBnb2xk?= Microsoft Frontpage 3 6th May 2007 05:22 PM
tables - green borders? blue borders? yikes DianaH Microsoft Frontpage 4 13th Oct 2005 09:22 AM
Why does page borders not appear in my borders and shading format. =?Utf-8?B?TW93Z2xp?= Microsoft Word Document Management 4 11th Jan 2005 08:40 PM
Page borders and table borders =?Utf-8?B?SGVsZW4=?= Microsoft Word Document Management 3 24th Sep 2004 01:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:14 PM.