Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Place Thin Border around Cell

I only want to code a line which instructs VBA to
Place a thin border around a cell.

With Range("G2")
.Range("A1").Formula = "=SUBTOTAL(9,$G$5:$G$50)"
.Range("A1").Interior.ColorIndex = 6
.Range("A1").Font.Bold = True
.Range("A1").Style = "Comma"
<<<<<<<<<<<??????
End With

I did a Record Macro to get the code,, I only Clicked on the single icon
with the Full continuous line around the cell (top,left,right,& bottom)
and when I examined the code it was 15-20 lines << What is the SKINNY
of this auto produced code to produce a SIMPLE Border (All-Round type)?

TIA,

Jim May

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default Place Thin Border around Cell

I don't know that there is an easy way to complete all borders:

With Range("A1")
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
End With

Jason

"JMay" wrote:

I only want to code a line which instructs VBA to
Place a thin border around a cell.

With Range("G2")
.Range("A1").Formula = "=SUBTOTAL(9,$G$5:$G$50)"
.Range("A1").Interior.ColorIndex = 6
.Range("A1").Font.Bold = True
.Range("A1").Style = "Comma"
<<<<<<<<<<<??????
End With

I did a Record Macro to get the code,, I only Clicked on the single icon
with the Full continuous line around the cell (top,left,right,& bottom)
and when I examined the code it was 15-20 lines << What is the SKINNY
of this auto produced code to produce a SIMPLE Border (All-Round type)?

TIA,

Jim May


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default Place Thin Border around Cell

Please ignore last post...

.Range("A1").BorderAround Weight:=xlHairline

HTH

Jason

"JMay" wrote:

I only want to code a line which instructs VBA to
Place a thin border around a cell.

With Range("G2")
.Range("A1").Formula = "=SUBTOTAL(9,$G$5:$G$50)"
.Range("A1").Interior.ColorIndex = 6
.Range("A1").Font.Bold = True
.Range("A1").Style = "Comma"
<<<<<<<<<<<??????
End With

I did a Record Macro to get the code,, I only Clicked on the single icon
with the Full continuous line around the cell (top,left,right,& bottom)
and when I examined the code it was 15-20 lines << What is the SKINNY
of this auto produced code to produce a SIMPLE Border (All-Round type)?

TIA,

Jim May


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Place Thin Border around Cell

With Range("G2")
.Range("A1").Formula = "=SUBTOTAL(9,$G$5:$G$50)"
.Range("A1").Interior.ColorIndex = 6
.Range("A1").Font.Bold = True
.Range("A1").Style = "Comma"
.Range("A1").BorderAround weight:=xlThin

End With


"JMay" wrote:

I only want to code a line which instructs VBA to
Place a thin border around a cell.

With Range("G2")
.Range("A1").Formula = "=SUBTOTAL(9,$G$5:$G$50)"
.Range("A1").Interior.ColorIndex = 6
.Range("A1").Font.Bold = True
.Range("A1").Style = "Comma"
<<<<<<<<<<<??????
End With

I did a Record Macro to get the code,, I only Clicked on the single icon
with the Full continuous line around the cell (top,left,right,& bottom)
and when I examined the code it was 15-20 lines << What is the SKINNY
of this auto produced code to produce a SIMPLE Border (All-Round type)?

TIA,

Jim May


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Place Thin Border around Cell

Jason:
Tom Ogilvy recommended:

..Range("A1").BorderAround Weight:=xlThin

Works great!!

Jim May


"Jason" wrote in message
:

I don't know that there is an easy way to complete all borders:

With Range("A1")
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlHairline
End With
End With

Jason

"JMay" wrote:

I only want to code a line which instructs VBA to
Place a thin border around a cell.

With Range("G2")
.Range("A1").Formula = "=SUBTOTAL(9,$G$5:$G$50)"
.Range("A1").Interior.ColorIndex = 6
.Range("A1").Font.Bold = True
.Range("A1").Style = "Comma"
<<<<<<<<<<<??????
End With

I did a Record Macro to get the code,, I only Clicked on the single icon
with the Full continuous line around the cell (top,left,right,& bottom)
and when I examined the code it was 15-20 lines << What is the SKINNY
of this auto produced code to produce a SIMPLE Border (All-Round type)?

TIA,

Jim May



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
border on last cell of page effects border on beginning cell of ne GaryE Excel Discussion (Misc queries) 0 March 23rd 09 05:47 AM
Place a Bottom Border in a Table via a Macro [email protected] Excel Discussion (Misc queries) 0 February 25th 07 11:19 PM
create a thin border around the selected cells Chandra Lee New Users to Excel 1 July 24th 06 01:53 PM
How to place a border on every page in excel? potential_gold Excel Worksheet Functions 0 June 29th 05 02:22 PM
How to create thin cell border Dale Fox Excel Discussion (Misc queries) 4 December 7th 04 04:37 AM


All times are GMT +1. The time now is 10:34 AM.

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"