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


Hi!
What would the code look like for the following:

I want to navigate to (make active) a specific cell within a name
range even if the range definition changes.

I want to (go to) or make the active cell the last cell in a name
range ie. Range "rng1" is A1:A9 and I want the active cell to be A9 bu
if the range definition changes to A1:A12 I want the code to make A1
the active cell.

What if the range is defined as A1:D12 is there a way to get to A12 o
B12 or A1 or B1 ect.?

Thanks for any help or direction

--
Brian Matlac
-----------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...nfo&userid=350
View this thread: http://www.excelforum.com/showthread.php?threadid=54478

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default Navigating with a macro

The following macro counts the number of cells in the range name MyRange and
then activates the last cell in that range.

Sub LastCell()

Dim r As Range
Dim l As Long

Set r = Range("MyRange")
l = r.Cells.Count

r.Cells(l).Activate

Set r = Nothing

End Sub

--
Kevin Backmann


"Brian Matlack" wrote:


Hi!
What would the code look like for the following:

I want to navigate to (make active) a specific cell within a named
range even if the range definition changes.

I want to (go to) or make the active cell the last cell in a named
range ie. Range "rng1" is A1:A9 and I want the active cell to be A9 but
if the range definition changes to A1:A12 I want the code to make A12
the active cell.

What if the range is defined as A1:D12 is there a way to get to A12 or
B12 or A1 or B1 ect.?

Thanks for any help or direction.


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=544780


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Navigating with a macro


Hi Kevin!
Thanks for the help. it works great!!


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=544780

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
Navigating ~ One Fine Old Dude Excel Worksheet Functions 0 June 6th 07 06:38 PM
Navigating ~ One Fine Old Dude Excel Worksheet Functions 0 June 6th 07 06:35 PM
navigating with the tab key Cynthia[_2_] New Users to Excel 1 April 17th 07 05:18 PM
Navigating Gibbie Excel Discussion (Misc queries) 9 January 31st 05 10:49 PM
Navigating with a macro Brian Matlack[_3_] Excel Programming 5 February 19th 04 04:43 PM


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