LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,766
Default Bordering

Hi,

I am just trying my hand with this macro. The purpose of this macro is to
colour code the content of every alternate cell in the selected range to Blue
(which is happening) and border it with a blue dotted box (which is not
happening). I have written this code but it does not seem to work correctly.
The macro should actually put a border around the cells in the selected
range. However, it borders the active cell in the range and in the other
alternate cell it just puts a border on three sides.


Any help would be highly appreciated


Sub Dotted_box()

For Each c In ActiveCell.CurrentRegion.Cells
If c.Column Mod 2 < 0 Then

ActiveCell.Font.ColorIndex = 5

With ActiveCell.BorderAround(xlContinuous, xlHairline, 5)

End With
End If
Next c

Selection.Font.ColorIndex = 5

With Selection.BorderAround(xlContinuous, xlHairline, 5)

End With

End Sub

Regards,
 
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
Bordering in Excell olrjr Excel Discussion (Misc queries) 2 December 31st 08 11:51 PM
line bordering hidden cells EllenM Excel Discussion (Misc queries) 2 May 11th 07 11:47 AM
Cell bordering Albert Jameson Excel Programming 3 October 13th 04 05:18 AM


All times are GMT +1. The time now is 11:44 PM.

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

About Us

"It's about Microsoft Excel"