Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 504
Default easy one - select a cell

Hi

I want to be able to select a range eg
Application.Goto Reference:="Asset"

Once I have done this I want to be able to deduce what the first cell in the
range is eg "F1". I want to do this so I can reset the range when people add
to it

Also is there an easier way to write code to resize the range ie below is
recorded but I just want to be able to say =range("F1","F11") etc
ActiveWorkbook.Names.Add Name:="Asset", RefersToR1C1:= _
"=Tables!R2C6:R11C6"


Thanks

--
Kevin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default easy one - select a cell

activesheet.range("f1:f11").name = "asset"

But you may want to look at using a dynamic range name that can grow and
contract...

Debra Dalgleish explains it:
http://contextures.com/xlNames01.html#Dynamic

Kevin wrote:

Hi

I want to be able to select a range eg
Application.Goto Reference:="Asset"

Once I have done this I want to be able to deduce what the first cell in the
range is eg "F1". I want to do this so I can reset the range when people add
to it

Also is there an easier way to write code to resize the range ie below is
recorded but I just want to be able to say =range("F1","F11") etc
ActiveWorkbook.Names.Add Name:="Asset", RefersToR1C1:= _
"=Tables!R2C6:R11C6"

Thanks

--
Kevin


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default easy one - select a cell

Here is one way to resize a named range that has items added:

Sub test()
Dim NewRng As Range
Set NewRng = Range("Asset").CurrentRegion
ActiveWorkbook.Names.Add Name:="Asset", RefersTo:=NewRng
End Sub

The CurrentRegion is all non empty cells that are adjacent (contiguous) with
named range "Asset"
Mike F


"Kevin" wrote in message
...
Hi

I want to be able to select a range eg
Application.Goto Reference:="Asset"

Once I have done this I want to be able to deduce what the first cell in
the
range is eg "F1". I want to do this so I can reset the range when people
add
to it

Also is there an easier way to write code to resize the range ie below is
recorded but I just want to be able to say =range("F1","F11") etc
ActiveWorkbook.Names.Add Name:="Asset", RefersToR1C1:= _
"=Tables!R2C6:R11C6"


Thanks

--
Kevin



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default easy one - select a cell

just some extra info, select used for illustration:

if you have a range selected, this will select the upper left cell.
ActiveCell.CurrentRegion.Cells(1, 1).Select

if you want to select the upper left cell in a range using the name:
ActiveSheet.Range("Range_Name").Cells(1, 1).Select

--


Gary


"Kevin" wrote in message
...
Hi

I want to be able to select a range eg
Application.Goto Reference:="Asset"

Once I have done this I want to be able to deduce what the first cell in
the
range is eg "F1". I want to do this so I can reset the range when people
add
to it

Also is there an easier way to write code to resize the range ie below is
recorded but I just want to be able to say =range("F1","F11") etc
ActiveWorkbook.Names.Add Name:="Asset", RefersToR1C1:= _
"=Tables!R2C6:R11C6"


Thanks

--
Kevin



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
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
Easy question - If ...then Change cell value Mike R. Excel Programming 3 July 30th 05 04:50 AM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
Easy one: Focus off individual cell? jasonsweeney[_62_] Excel Programming 1 April 7th 04 08:10 PM


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