Naming range question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Dim myRange As Range
Set myRange = Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
myRange.Name = "fulldata"
 
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?
 
Set rng = Range("fulldata")(Range("fulldata").Count)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Dim rngfulldata As Range
Set rngfulldata = Range("A2:" & _
ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Address)
rngfulldata.Name = "fulldata"

Ken Johnson
 

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

Back
Top