Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Range always being the right size

Hi all, this is bugging me!, I want to set a range in a formula that is
always only the cells with stuff in, I was going to put make named
ranges with a button but it doesnt want to play! any ideas?

Private Sub CommandButton2_Click()
Set Rng1a = Range("A2")
Set RnG1 = Range("A1").End(xlDown)
ActiveWorkbook.Names.Add Name:="ARNG", RefersTo:=Rng1a: Rng1
End Sub

The last line will not create the A range (ARNG), i just want a range
called ARNG that refers to a2 to the last cell with stuff in in column
A.

Im sure this should be easy!

(my formula in excel will then refer to ARNG)

Duncan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Range always being the right size

Very simply done AP, im well impressed!,

I have just finally managed to work it by:

Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Set EndA = Selection
ActiveWorkbook.Names.Add Name:="DRNG", RefersTo:=EndA


But I will change to your code now I can see how it should be done,
many thanks indeed!

Duncan

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
Cannot Expand Named Range - when size of the Range exceeds Snig Excel Discussion (Misc queries) 1 July 7th 05 01:46 PM
Determine the size of a range Dr.Schwartz Excel Programming 7 May 27th 05 12:45 PM
Determining the size of a range. Dave the wave Excel Programming 3 June 30th 04 01:47 AM
Maximum Range size? andycharger[_29_] Excel Programming 1 May 10th 04 10:24 AM
How to determine a range size cici Excel Programming 1 February 11th 04 10:16 PM


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