Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to select a range starting with A6 and ending with the last entry
in column A and including 13 columns to the right. I have the code below, but it doesn't work. The last line the containg the range "A6:LwrRight" doesn't work. I think it's because I'm using a range where a cell reference is needed. Any Help. Thanks Bill Private Sub Dim LwrRight As Range Range("A6").Select 'Range(Selection, Selection.End(xlDown)).Select Selection.End(xlDown).Select ActiveCell.Offset(0, 13).Activate Set LwrRight = ActiveCell Range("A6:LwrRight").Select End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
Sub test() Dim x As Long Dim rngRange As Range With ActiveSheet x = .Range("A65536").End(xlUp).Row End With Set rngRange = Range("A6:M" & x) rngRange.Select End Sub "Bill" wrote in message ... I am trying to select a range starting with A6 and ending with the last entry in column A and including 13 columns to the right. I have the code below, but it doesn't work. The last line the containg the range "A6:LwrRight" doesn't work. I think it's because I'm using a range where a cell reference is needed. Any Help. Thanks Bill Private Sub Dim LwrRight As Range Range("A6").Select 'Range(Selection, Selection.End(xlDown)).Select Selection.End(xlDown).Select ActiveCell.Offset(0, 13).Activate Set LwrRight = ActiveCell Range("A6:LwrRight").Select End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim wks as worksheet
dim myRng as Range dim LastRow as long set wks = worksheets("Sheet1") with wks lastrow = .cells(.rows.count,"A").end(xlup).row set myrng = .range("a6:M" & lastrow) 'more stuff end with I stopped with column M. Was that 13 to the right? Bill wrote: I am trying to select a range starting with A6 and ending with the last entry in column A and including 13 columns to the right. I have the code below, but it doesn't work. The last line the containg the range "A6:LwrRight" doesn't work. I think it's because I'm using a range where a cell reference is needed. Any Help. Thanks Bill Private Sub Dim LwrRight As Range Range("A6").Select 'Range(Selection, Selection.End(xlDown)).Select Selection.End(xlDown).Select ActiveCell.Offset(0, 13).Activate Set LwrRight = ActiveCell Range("A6:LwrRight").Select End Sub -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("A6").Resize(Cells(Rows.Count,"A").End(xlUp) .Row-5,13).Select
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Bill" wrote in message ... I am trying to select a range starting with A6 and ending with the last entry in column A and including 13 columns to the right. I have the code below, but it doesn't work. The last line the containg the range "A6:LwrRight" doesn't work. I think it's because I'm using a range where a cell reference is needed. Any Help. Thanks Bill Private Sub Dim LwrRight As Range Range("A6").Select 'Range(Selection, Selection.End(xlDown)).Select Selection.End(xlDown).Select ActiveCell.Offset(0, 13).Activate Set LwrRight = ActiveCell Range("A6:LwrRight").Select End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("A6",cells(rows.count,1).End(xlup)).Resize(, 13).Select
-- Regards, Tom Ogilvy "Bill" wrote: I am trying to select a range starting with A6 and ending with the last entry in column A and including 13 columns to the right. I have the code below, but it doesn't work. The last line the containg the range "A6:LwrRight" doesn't work. I think it's because I'm using a range where a cell reference is needed. Any Help. Thanks Bill Private Sub Dim LwrRight As Range Range("A6").Select 'Range(Selection, Selection.End(xlDown)).Select Selection.End(xlDown).Select ActiveCell.Offset(0, 13).Activate Set LwrRight = ActiveCell Range("A6:LwrRight").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
selecting Variable range | Excel Programming | |||
selecting a variable row range | Excel Programming | |||
Selecting a variable range | Excel Programming | |||
Selecting a variable range | Excel Programming | |||
Selecting a Range Using a Variable | Excel Programming |