Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Locate cell in Named Range

Anyone know how to programatically find the bottom left cell of a named
range? I need to find that cell, and insert an entire row beneath it.
Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Locate cell in Named Range

Hello Steph
This will return address of the bottom left cell:
MyName = ThisWorkbook.Names("YourName").RefersToRange.Value
MsgBox Cells(UBound(MyName, 1), LBound(MyName, 2)).Address

HTH
Cordially
Pascal

"Steph" a écrit dans le message de
...
Anyone know how to programatically find the bottom left cell of a named
range? I need to find that cell, and insert an entire row beneath it.
Thanks!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Locate cell in Named Range

To insert row to the next line:
Range(Cells(UBound(MyName, 1), LBound(MyName, 2)).Address).Offset(1,
0).EntireRow.Insert

HTH
Cordially
Pascal

"papou" <cestpasbonprobin@çanonpluscg44_fr a écrit dans le message de
...
Hello Steph
This will return address of the bottom left cell:
MyName = ThisWorkbook.Names("YourName").RefersToRange.Value
MsgBox Cells(UBound(MyName, 1), LBound(MyName, 2)).Address

HTH
Cordially
Pascal

"Steph" a écrit dans le message de
...
Anyone know how to programatically find the bottom left cell of a named
range? I need to find that cell, and insert an entire row beneath it.
Thanks!






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Locate cell in Named Range

myname().Value would raise an error. An array doesn't have an address
property.

--
Regards,
Tom Ogilvy

"papou" <cestpasbonprobin@çanonpluscg44_fr wrote in message
...
Hello Steph
This will return address of the bottom left cell:
MyName = ThisWorkbook.Names("YourName").RefersToRange.Value
MsgBox Cells(UBound(MyName, 1), LBound(MyName, 2)).Address

HTH
Cordially
Pascal

"Steph" a écrit dans le message de
...
Anyone know how to programatically find the bottom left cell of a named
range? I need to find that cell, and insert an entire row beneath it.
Thanks!






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Locate cell in Named Range

sorry - my mistake - didn't look at the code closely enough.

I should have said this will only work if the range starts in Cell A1.

for instance;
Sub AAABBBDDD()
Range("B9:H30").Name = "YourName"
MyName = ThisWorkbook.Names("YourName").RefersToRange.Value
MsgBox Cells(UBound(MyName, 1), LBound(MyName, 2)).Address
End Sub

Returns A22.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
myname().Value would raise an error. An array doesn't have an address
property.

--
Regards,
Tom Ogilvy

"papou" <cestpasbonprobin@çanonpluscg44_fr wrote in message
...
Hello Steph
This will return address of the bottom left cell:
MyName = ThisWorkbook.Names("YourName").RefersToRange.Value
MsgBox Cells(UBound(MyName, 1), LBound(MyName, 2)).Address

HTH
Cordially
Pascal

"Steph" a écrit dans le message de
...
Anyone know how to programatically find the bottom left cell of a

named
range? I need to find that cell, and insert an entire row beneath it.
Thanks!










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Locate cell in Named Range

Tom
You're right, unfortunately this does not seem to work for names not
starting in A1

Cordially
Pascal

"Tom Ogilvy" a écrit dans le message de
...
sorry - my mistake - didn't look at the code closely enough.

I should have said this will only work if the range starts in Cell A1.

for instance;
Sub AAABBBDDD()
Range("B9:H30").Name = "YourName"
MyName = ThisWorkbook.Names("YourName").RefersToRange.Value
MsgBox Cells(UBound(MyName, 1), LBound(MyName, 2)).Address
End Sub

Returns A22.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
myname().Value would raise an error. An array doesn't have an address
property.

--
Regards,
Tom Ogilvy

"papou" <cestpasbonprobin@çanonpluscg44_fr wrote in message
...
Hello Steph
This will return address of the bottom left cell:
MyName = ThisWorkbook.Names("YourName").RefersToRange.Value
MsgBox Cells(UBound(MyName, 1), LBound(MyName, 2)).Address

HTH
Cordially
Pascal

"Steph" a écrit dans le message de
...
Anyone know how to programatically find the bottom left cell of a

named
range? I need to find that cell, and insert an entire row beneath

it.
Thanks!










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Locate cell in Named Range

Hello Tom
The sample code I provided does not use the syntax you mention.
I tested succesfully on my Excel 2003.

Cordially
Pascal

"Tom Ogilvy" a écrit dans le message de
...
myname().Value would raise an error. An array doesn't have an address
property.

--
Regards,
Tom Ogilvy

"papou" <cestpasbonprobin@çanonpluscg44_fr wrote in message
...
Hello Steph
This will return address of the bottom left cell:
MyName = ThisWorkbook.Names("YourName").RefersToRange.Value
MsgBox Cells(UBound(MyName, 1), LBound(MyName, 2)).Address

HTH
Cordially
Pascal

"Steph" a écrit dans le message de
...
Anyone know how to programatically find the bottom left cell of a

named
range? I need to find that cell, and insert an entire row beneath it.
Thanks!








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Locate cell in Named Range

Yes, it was my mistake. It does work if the range starts in A1. Otherwise,
wrong answer.
See my previous post stating this.

--
Regards,
Tom Ogilvy

"papou" <cestpasbonprobin@çanonpluscg44_fr wrote in message
...
Hello Tom
The sample code I provided does not use the syntax you mention.
I tested succesfully on my Excel 2003.

Cordially
Pascal

"Tom Ogilvy" a écrit dans le message de
...
myname().Value would raise an error. An array doesn't have an address
property.

--
Regards,
Tom Ogilvy

"papou" <cestpasbonprobin@çanonpluscg44_fr wrote in message
...
Hello Steph
This will return address of the bottom left cell:
MyName = ThisWorkbook.Names("YourName").RefersToRange.Value
MsgBox Cells(UBound(MyName, 1), LBound(MyName, 2)).Address

HTH
Cordially
Pascal

"Steph" a écrit dans le message de
...
Anyone know how to programatically find the bottom left cell of a

named
range? I need to find that cell, and insert an entire row beneath

it.
Thanks!










  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Locate cell in Named Range

try
Sub lrr()
MsgBox Range("rngN").Rows.Count
End Sub
--
Don Guillett
SalesAid Software

"Steph" wrote in message
...
Anyone know how to programatically find the bottom left cell of a named
range? I need to find that cell, and insert an entire row beneath it.
Thanks!




  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Locate cell in Named Range

sorry, sent this to you email:

If it is contiguous (a single area range)

set rng = Range("ABCD")
rng.rows(rng.rows.count).offset(1,0).EntireRow.Ins ert

--
Regards,
Tom Ogilvy



"Steph" wrote in message
...
Anyone know how to programatically find the bottom left cell of a named
range? I need to find that cell, and insert an entire row beneath it.
Thanks!






  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Locate cell in Named Range

Thanks everyone!

"Tom Ogilvy" wrote in message
...
sorry, sent this to you email:

If it is contiguous (a single area range)

set rng = Range("ABCD")
rng.rows(rng.rows.count).offset(1,0).EntireRow.Ins ert

--
Regards,
Tom Ogilvy



"Steph" wrote in message
...
Anyone know how to programatically find the bottom left cell of a named
range? I need to find that cell, and insert an entire row beneath it.
Thanks!






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
locate a cell value within a range and return its reference Adam Excel Discussion (Misc queries) 0 April 8th 08 11:23 AM
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
named cell range Marilyn Excel Worksheet Functions 2 March 13th 06 07:42 PM
Getting a named range from a cell value Charles Woll Excel Worksheet Functions 2 February 25th 05 03:39 PM


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