Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
borders | Excel Discussion (Misc queries) | |||
Borders | Excel Discussion (Misc queries) | |||
Borders | Excel Discussion (Misc queries) | |||
Borders | Excel Worksheet Functions | |||
weird saving of a document with macros resulting with macros being transfered to the copy | Excel Programming |