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: 184
Default Insert Border

Hi all. The below snippet of code inserts a row at a change in data
in column A, and colors the row grey.

Cells(x, 4).EntireRow.Insert shift:=xlDown
Cells(x, 4).Offset(0, -3).Resize(1, LastCol).Interior.ColorIndex =
15

As opposed to inserting a row, I would like to create a border. I
recorded the below code with the macro recorder, but can't seem to
figure out how to incorporate the variables I have in the above code!

With Selection.Borders(xlEdgeBottom)
.Color = -16777024
.Weight = xlThick
End With

I attempted this, but obviously did not work! Thanks!

With Cells(x, 4)
.Offset(0, -3).Resize(1, LastCol).Borders
(xlEdgeBottom)
.Color = -16777024
.Weight = xlThick
End With
 
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
Insert a border into a header or footer in Excel 2007 ktyn Excel Discussion (Misc queries) 0 December 2nd 09 05:59 PM
Insert xlBottom border to group data Forgone Excel Programming 2 September 14th 09 10:26 AM
Apply bottom border only on filled cells, leaves blank cells without border? StargateFan[_3_] Excel Programming 4 April 8th 07 05:39 PM
Insert Rows with Border Formatting ksp Excel Programming 3 May 2nd 06 01:50 AM
Changing the border of one cell s/n change the border of adjacent gjanssenmn Excel Discussion (Misc queries) 2 October 5th 05 08:35 PM


All times are GMT +1. The time now is 01:38 AM.

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"