ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Borders on Fixed # of Columns, Variable # of Rows (https://www.excelbanter.com/excel-programming/400283-borders-fixed-columns-variable-rows.html)

BEEJAY

Borders on Fixed # of Columns, Variable # of Rows
 
Looking to put "std" width borders on all but outside edges of range
which should be "heavy"
Getting stuck identifying the "variable" range.

Fixed Columns: B3 thru F3
Variable Rows: Any possible number

I got:

LastRow = Worksheets(1).Cells(Rows.Count, "E").End(xlUp).Row
Range ("B3:G" & LastRow) <<<<<<< Comes up as "COMPILE ERROR"



Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)


joel

Borders on Fixed # of Columns, Variable # of Rows
 
You left off the select on the range statement

Range ("B3:G" & LastRow).select

"BEEJAY" wrote:

Looking to put "std" width borders on all but outside edges of range
which should be "heavy"
Getting stuck identifying the "variable" range.

Fixed Columns: B3 thru F3
Variable Rows: Any possible number

I got:

LastRow = Worksheets(1).Cells(Rows.Count, "E").End(xlUp).Row
Range ("B3:G" & LastRow) <<<<<<< Comes up as "COMPILE ERROR"



Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)


Jim Thomlinson

Borders on Fixed # of Columns, Variable # of Rows
 
Based on the rest of your code you probably want to select that range. So
just add the .select at the end something like this...

Range("B3:G" & LastRow).select
--
HTH...

Jim Thomlinson


"BEEJAY" wrote:

Looking to put "std" width borders on all but outside edges of range
which should be "heavy"
Getting stuck identifying the "variable" range.

Fixed Columns: B3 thru F3
Variable Rows: Any possible number

I got:

LastRow = Worksheets(1).Cells(Rows.Count, "E").End(xlUp).Row
Range ("B3:G" & LastRow) <<<<<<< Comes up as "COMPILE ERROR"



Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)


BEEJAY

Borders on Fixed # of Columns, Variable # of Rows
 
Gentlemen:
Thanks for the prompt response.
I'll just go and wipe the egg off my face now!!!

"Jim Thomlinson" wrote:

Based on the rest of your code you probably want to select that range. So
just add the .select at the end something like this...

Range("B3:G" & LastRow).select
--
HTH...

Jim Thomlinson


"BEEJAY" wrote:

Looking to put "std" width borders on all but outside edges of range
which should be "heavy"
Getting stuck identifying the "variable" range.

Fixed Columns: B3 thru F3
Variable Rows: Any possible number

I got:

LastRow = Worksheets(1).Cells(Rows.Count, "E").End(xlUp).Row
Range ("B3:G" & LastRow) <<<<<<< Comes up as "COMPILE ERROR"



Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)



All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com