Re: Setting var to selected Range

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



dim myRng as range
set myrng = Range(Selection, ActiveCell.SpecialCells(xlLastCell))

or after your last line:

set myrng = selection



El Bee wrote:

I discovered the following statement
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select

now I want to set a var to the selected range.

Can anyone help; this VB stuff is all new to me and I really appreciate the
help I have received from many of the Guru's on this site!!!

Thanks again for your time and knowledge.

El Bee

--

Dave Peterson
.



Relevant Pages

  • Re: How to determine which rows contain slected cells in a multipl
    ... Dim myArea As Range ... > Dim myRng As Range ... > Set myRng = Selection ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Count of rows - discontiguous selection
    ... Dim myRng As Range ... Set myRng = Intersect, Selection.EntireRow) ... If the discontiguous areas could be in overlapping rows, ... I need a code that will count the number of rows in a selection; ...
    (microsoft.public.excel.programming)
  • Re: Advice re Insertion Point
    ... Use a range instead of a the selection. ... Sub Test() ... Dim myRng As Range ... Set myRng = ActiveDocument.Range ...
    (microsoft.public.word.vba.general)
  • Re: Cant Undo Macro Command
    ... The trouble is, when I run the code, I still can't undo. ... Dim myRng As Range ... Set myRng = Selection.Areas ... ' Specify the Undo Sub ...
    (microsoft.public.excel.programming)
  • Re: Range
    ... with selection ... For CopieNumber = 2 To 35 ... Set myRng = Nothing ... On Error GoTo 0 ...
    (microsoft.public.excel.misc)