Defining Range

M

MAB

How do I define a range from sheet1!a2 to the last nonempty cell in the A
column
The name of the range should be equal to sheet!a1 ( the top most cell )

similarly for other columns b, c, d, e
 
T

Tom Ogilvy

With Worksheets("Sheet1")
set rng = .Range(.Range("A2"),.Cells(rows.count,1).End(xlup))
End With


similarly for b, c, d, e
 
A

Arvi Laanemets

Hi

Without VBA

=OFFSET(Sheet1!$A$2,,,COUNTIF(Sheet1!$A:$A)-1)
but you have to enter the name manually. And you mustn't have gaps in column
A.


Arvi Laanemets
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top