Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 75
Default Macro formatting last row

Brilliant! That did it -- thanks so much :-)

"Gary''s Student" wrote:

Just resize it:

Sub dural()
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
Range("B" & lastrow).Resize(1, 3).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
End Sub

--
Gary''s Student - gsnu201001


"Erin" wrote:

I tried posting this question earlier and received an error message, so I
apologize if this question shows up twice.

I'm trying to insert a bottom border on a range of cells, but I can't figure
out the syntax for the range. Here's what I currently have:

Range("B" & lastrow).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With

This works for column B, but I want the border to also be on column C and D.
I could add the same code for each column separately, but I'm wondering if
there is a way to do the entire range (B:D) at one time.

Thanks!

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
formatting macro help [email protected] Excel Discussion (Misc queries) 2 March 10th 09 12:53 PM
Formatting using Macro simplymidori[_2_] Excel Discussion (Misc queries) 4 April 11th 08 12:22 AM
Formatting for a Macro Maggie Excel Discussion (Misc queries) 3 February 28th 07 02:00 AM
Formatting via a macro mike_vr Excel Discussion (Misc queries) 3 November 8th 06 04:19 PM
Conditional Formatting in Macro shantanu oak Excel Discussion (Misc queries) 2 July 14th 06 01:11 PM


All times are GMT +1. The time now is 06:48 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"