Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Naming range question

I want to name a range (fulldata) starting at cell A2 on the worksheet and
ending at the last cell with a value in it on the same worksheet using VBA
code. Again, I need help.

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Naming range question

Dim myRange As Range
Set myRange = Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
myRange.Name = "fulldata"


--
Cheers
Nigel



"Billy B" wrote in message
...
I want to name a range (fulldata) starting at cell A2 on the worksheet and
ending at the last cell with a value in it on the same worksheet using VBA
code. Again, I need help.

Thank you.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Naming range question

Thank you. This works to find the last cell in the same column but I need to
find the last cell used on the worksheet. It might be N1800 or G50. It will
never be the same. Could you help me with that?

"Nigel" wrote:

Dim myRange As Range
Set myRange = Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
myRange.Name = "fulldata"


--
Cheers
Nigel



"Billy B" wrote in message
...
I want to name a range (fulldata) starting at cell A2 on the worksheet and
ending at the last cell with a value in it on the same worksheet using VBA
code. Again, I need help.

Thank you.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Naming range question

Set rng = Range("fulldata")(Range("fulldata").Count)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Billy B" wrote in message
...
Thank you. This works to find the last cell in the same column but I need

to
find the last cell used on the worksheet. It might be N1800 or G50. It

will
never be the same. Could you help me with that?

"Nigel" wrote:

Dim myRange As Range
Set myRange = Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
myRange.Name = "fulldata"


--
Cheers
Nigel



"Billy B" wrote in message
...
I want to name a range (fulldata) starting at cell A2 on the worksheet

and
ending at the last cell with a value in it on the same worksheet using

VBA
code. Again, I need help.

Thank you.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Naming range question

Dim rngfulldata As Range
Set rngfulldata = Range("A2:" & _
ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell) .Address)
rngfulldata.Name = "fulldata"

Ken Johnson

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
Naive question on Range naming but please answer DoctorG Excel Programming 7 October 10th 05 03:28 PM
Question about tab naming and referenced cells Husker87 Excel Discussion (Misc queries) 1 March 3rd 05 10:19 PM
VB Code Naming a Range (range changes each time) krazylain Excel Programming 4 May 15th 04 12:41 PM
Sheet naming question Mark R[_3_] Excel Programming 6 December 21st 03 07:26 PM
Yet another question naming ranges No Name Excel Programming 5 December 3rd 03 02:19 PM


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