Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Borders with Macros


I would like to put a border around data using a macro. In some cases
may need to border A1:AC44 and in other cases it may be A1:AC45. In al
cases the A1 is static and AC is static but the row is determined b
where the field 'Grand Total' is located.

How do i create a relative reference to put a border around thi
information

--
waynehind
-----------------------------------------------------------------------
waynehinds's Profile: http://www.excelforum.com/member.php...fo&userid=2533
View this thread: http://www.excelforum.com/showthread.php?threadid=38811

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Borders with Macros

Check these out

MsgBox ActiveSheet.UsedRange.Address
=============================
Dim LASTROW As Integer, rng as Range

LASTROW = Cells(Rows.COUNT, "A").End(xlUp).Row
set rng = Range("A1:AC" & LASTROW)
--
steveB

Remove "AYN" from email to respond
"waynehinds" wrote
in message ...

I would like to put a border around data using a macro. In some cases I
may need to border A1:AC44 and in other cases it may be A1:AC45. In all
cases the A1 is static and AC is static but the row is determined by
where the field 'Grand Total' is located.

How do i create a relative reference to put a border around this
information.


--
waynehinds
------------------------------------------------------------------------
waynehinds's Profile:
http://www.excelforum.com/member.php...o&userid=25331
View this thread: http://www.excelforum.com/showthread...hreadid=388111



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Borders with Macros


Thanks for advice. That statement worked fine.

What if I wanted to put a different outline starting with the row belo
it.

For example I search for Grand Total and in the row below that an
always in column s i want to outline five boxes

--
waynehind
-----------------------------------------------------------------------
waynehinds's Profile: http://www.excelforum.com/member.php...fo&userid=2533
View this thread: http://www.excelforum.com/showthread.php?threadid=38811

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Borders with Macros

Just add 1

LASTROW = Cells(Rows.COUNT, "A").End(xlUp).Row+1
set rng = Range("A1:AC" & LASTROW)

or
LASTROW = Cells(Rows.COUNT, "A").End(xlUp).Offset(1, 0).Row
set rng = Range("A1:AC" & LASTROW)

Glad it worked!!!
--
steveB

Remove "AYN" from email to respond
"waynehinds" wrote
in message ...

Thanks for advice. That statement worked fine.

What if I wanted to put a different outline starting with the row below
it.

For example I search for Grand Total and in the row below that and
always in column s i want to outline five boxes.


--
waynehinds
------------------------------------------------------------------------
waynehinds's Profile:
http://www.excelforum.com/member.php...o&userid=25331
View this thread: http://www.excelforum.com/showthread...hreadid=388111



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
borders mhenley5 Excel Discussion (Misc queries) 2 May 5th 09 11:09 PM
Borders Derek Koehler Excel Discussion (Misc queries) 1 March 12th 09 02:19 PM
Borders Tucker Excel Discussion (Misc queries) 2 May 15th 07 06:41 AM
Borders anita Excel Worksheet Functions 6 September 15th 06 01:15 PM
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM


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