Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Bryant Smith   on Jan 30 In MS Office Category.

  
Question Answered By: Birk Fischer   on Jan 30

I use something like this in one of my macros I've adjusted it a
little, is this what you are after?

Sub DefineRange()

lastrow = ActiveSheet.UsedRange.Rows.Count

ActiveWorkbook.Names("MAMList").Delete 'deletes the existing
name range  (optional)

Sheets("Sheet1").Select
Cells(1, 1).Select 'defines the first cell of your range
Range(Selection, Selection.Offset(lastrow - 1, 3)).Select '
selects to the last row and the specified columns
Selection.Name = "MAMList" ' applies the name to the selected
range

End Sub

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on highlight a range using a named range Or get search suggestion and latest updates.


Tagged: