ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Dynamically set border in excel 2003? (https://www.excelbanter.com/new-users-excel/196614-dynamically-set-border-excel-2003-a.html)

veek

Dynamically set border in excel 2003?
 
i would like to use a border for a series of worksheets i am building in
excel 2003. content in the worksheets will be dynamic so i cannot
pre-determine the range. is there a way to tell excel to build the border
from A1:after-the-last-row-that-has-content-in-column-A"?

i doubt the content will ever extend beyond twnety or so rows but i don't
want to set a static border and then if a worksheet has only 3 rows, the
border doesn't print until after 17 blank rows.
--

thanks so much!
veek

Otto Moehrbach[_2_]

Dynamically set border in excel 2003?
 
Using VBA you can do that. The statement below defines a range of occupied
cells in Column A and 10 columns wide. You would need to add code to create
the borders or maybe even add code to first delete all existing borders
before creating them in a new range. Post back with more detail about the
type of borders you want if VBA is the way you want to go. HTH Otto
Set TheRng = Range("A1", Range("A" & Rows.Count).End(xlUp)).Resize(, 10)
"veek" wrote in message
...
i would like to use a border for a series of worksheets i am building in
excel 2003. content in the worksheets will be dynamic so i cannot
pre-determine the range. is there a way to tell excel to build the border
from A1:after-the-last-row-that-has-content-in-column-A"?

i doubt the content will ever extend beyond twnety or so rows but i don't
want to set a static border and then if a worksheet has only 3 rows, the
border doesn't print until after 17 blank rows.
--

thanks so much!
veek




veek

Dynamically set border in excel 2003?
 
Otto,

Thanks kindly for the reply. I think my biggest problem is being a novice
Excel user with expert intentions :-)

I hope I can explain this - I just wanted to have a simple border outlining
the outside of the range. The range is dynamic. The left and right borders
are known (i.e. there will never be content beyond column F). There will be
no blank rows in the midst of the range so if there is a way to tell excel to
put the bottom border after the last row with content, that would work.
Column A will contain numeric identifiers for each row so although it is
possible that a cell in column B, C, D, E, or F might be empty, column A will
always have content for active rows. SO really what I want to tell excel is
to put the bottom border after the last row that has content in column A.

--

thanks so much!
veek


"Otto Moehrbach" wrote:

Using VBA you can do that. The statement below defines a range of occupied
cells in Column A and 10 columns wide. You would need to add code to create
the borders or maybe even add code to first delete all existing borders
before creating them in a new range. Post back with more detail about the
type of borders you want if VBA is the way you want to go. HTH Otto
Set TheRng = Range("A1", Range("A" & Rows.Count).End(xlUp)).Resize(, 10)
"veek" wrote in message
...
i would like to use a border for a series of worksheets i am building in
excel 2003. content in the worksheets will be dynamic so i cannot
pre-determine the range. is there a way to tell excel to build the border
from A1:after-the-last-row-that-has-content-in-column-A"?

i doubt the content will ever extend beyond twnety or so rows but i don't
want to set a static border and then if a worksheet has only 3 rows, the
border doesn't print until after 17 blank rows.
--

thanks so much!
veek





Otto Moehrbach[_2_]

Dynamically set border in excel 2003?
 
Veek
This little macro first deletes all borders on the sheet, then places an
outline border around the range from A1 down to the last entry in Column A,
7 columns wide. Post back if you need more. HTH Otto
"veek" wrote in message
...
Otto,

Thanks kindly for the reply. I think my biggest problem is being a novice
Excel user with expert intentions :-)

I hope I can explain this - I just wanted to have a simple border
outlining
the outside of the range. The range is dynamic. The left and right
borders
are known (i.e. there will never be content beyond column F). There will
be
no blank rows in the midst of the range so if there is a way to tell excel
to
put the bottom border after the last row with content, that would work.
Column A will contain numeric identifiers for each row so although it is
possible that a cell in column B, C, D, E, or F might be empty, column A
will
always have content for active rows. SO really what I want to tell excel
is
to put the bottom border after the last row that has content in column A.

--

thanks so much!
veek


"Otto Moehrbach" wrote:

Using VBA you can do that. The statement below defines a range of
occupied
cells in Column A and 10 columns wide. You would need to add code to
create
the borders or maybe even add code to first delete all existing borders
before creating them in a new range. Post back with more detail about
the
type of borders you want if VBA is the way you want to go. HTH Otto
Set TheRng = Range("A1", Range("A" & Rows.Count).End(xlUp)).Resize(, 10)
"veek" wrote in message
...
i would like to use a border for a series of worksheets i am building in
excel 2003. content in the worksheets will be dynamic so i cannot
pre-determine the range. is there a way to tell excel to build the
border
from A1:after-the-last-row-that-has-content-in-column-A"?

i doubt the content will ever extend beyond twnety or so rows but i
don't
want to set a static border and then if a worksheet has only 3 rows,
the
border doesn't print until after 17 blank rows.
--

thanks so much!
veek







Otto Moehrbach[_2_]

Dynamically set border in excel 2003?
 
And I forgot to attach the macro. Otto
Sub PlaceBorders()
Dim rRng As Range
Cells.Borders.LineStyle = xlNone
Set rRng = Range("A1", Range("A" & Rows.Count).End(xlUp)).Resize(, 7)
rRng.BorderAround LineStyle:=xlContinuous, Weight:=xlThick
End Sub
"veek" wrote in message
...
Otto,

Thanks kindly for the reply. I think my biggest problem is being a novice
Excel user with expert intentions :-)

I hope I can explain this - I just wanted to have a simple border
outlining
the outside of the range. The range is dynamic. The left and right
borders
are known (i.e. there will never be content beyond column F). There will
be
no blank rows in the midst of the range so if there is a way to tell excel
to
put the bottom border after the last row with content, that would work.
Column A will contain numeric identifiers for each row so although it is
possible that a cell in column B, C, D, E, or F might be empty, column A
will
always have content for active rows. SO really what I want to tell excel
is
to put the bottom border after the last row that has content in column A.

--

thanks so much!
veek


"Otto Moehrbach" wrote:

Using VBA you can do that. The statement below defines a range of
occupied
cells in Column A and 10 columns wide. You would need to add code to
create
the borders or maybe even add code to first delete all existing borders
before creating them in a new range. Post back with more detail about
the
type of borders you want if VBA is the way you want to go. HTH Otto
Set TheRng = Range("A1", Range("A" & Rows.Count).End(xlUp)).Resize(, 10)
"veek" wrote in message
...
i would like to use a border for a series of worksheets i am building in
excel 2003. content in the worksheets will be dynamic so i cannot
pre-determine the range. is there a way to tell excel to build the
border
from A1:after-the-last-row-that-has-content-in-column-A"?

i doubt the content will ever extend beyond twnety or so rows but i
don't
want to set a static border and then if a worksheet has only 3 rows,
the
border doesn't print until after 17 blank rows.
--

thanks so much!
veek








All times are GMT +1. The time now is 06:33 AM.

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