LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default Find Range Borders (Cell Addresses) In VBA

use Long rather than Integer in the variable declaration



On 15 Maj, 10:44, FARAZ QURESHI
wrote:
ThanxJarek!

XClent!

Never had the idea of using Cells().Address!



"JarekKujawa" wrote:
use this macro:


Sub cus()
Dim min_row As Integer
Dim rows_count As Integer
Dim min_col As Integer
Dim cols_count As Integer
Dim Borders As String


min_row = Selection.Row
rows_count = Selection.Rows.Count
min_col = Selection.Column
cols_count = Selection.Columns.Count
Borders = Cells(min_row, min_col).Address & "," & Cells(min_row,
min_col + cols_count - 1).Address & "," & Cells(min_row + rows_count -
1, min_col).Address & "," & Cells(min_row + rows_count - 1, min_col +
cols_count - 1).Address


MsgBox "The active borders are " & Borders


End Sub


On 15 Maj, 08:52, FARAZ QURESHI
wrote:
I have a selected range, say X5:AC99. What piece of code would return a msgbox:
"The active range borders a
$X$5, $AC$5, $X$99 & $AC$99"- Ukryj cytowany tekst -


- Pokaż cytowany tekst -


 
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 for range Neil Pearce Excel Discussion (Misc queries) 0 April 8th 08 11:58 AM
Sorting a range loses formatted borders Jim Cone Excel Discussion (Misc queries) 2 February 25th 08 07:58 PM
Find cells without borders Marc C Excel Discussion (Misc queries) 0 February 21st 08 08:56 PM
find last cell in range with data, display cell address sevi61 Excel Worksheet Functions 14 October 29th 07 08:36 PM
Find a Cell Value In a Range Michael Excel Worksheet Functions 4 July 17th 07 10:03 PM


All times are GMT +1. The time now is 07:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"