Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Looking for a macro that selects a range from a portion of a row which is the Active Selection to the last non blank row bellow in the same columns as the Active Selection. The address of the current selection should be determined by VBA Thanks a lot Avi |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Arvi,
Try: '============= Public Sub Tester005() Dim rng As Range Dim FRow As Long Dim LRow As Long FRow = Selection.Row LRow = Cells(Rows.Count, Selection.Column).End(xlUp).Row Set rng = Selection.Resize(LRow - FRow + 1) rng.Select End Sub '<<============= --- Regards, Norman "Avi" wrote in message ... Hello, Looking for a macro that selects a range from a portion of a row which is the Active Selection to the last non blank row bellow in the same columns as the Active Selection. The address of the current selection should be determined by VBA Thanks a lot Avi |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A single column or the same size as the original selection
Dim TopCell As Range Dim BotCell As Range With ActiveSheet Set TopCell = ActiveCell Set BotCell = .Cells(.Rows.Count, TopCell.Column).End(xlUp) 'one column '.Range(TopCell, BotCell).Select 'or maybe multiple columns '.Range(TopCell, BotCell).Resize(, Selection.Columns.Count).Select End With Avi wrote: Hello, Looking for a macro that selects a range from a portion of a row which is the Active Selection to the last non blank row bellow in the same columns as the Active Selection. The address of the current selection should be determined by VBA Thanks a lot Avi -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Arvi,
Try: '============= Public Sub Tester005() Dim rng As Range Dim FRow As Long Dim LRow As Long FRow = Selection.Row LRow = Cells(Rows.Count, Selection.Column).End(xlUp).Row Set rng = Selection.Resize(LRow - FRow + 1) rng.Select End Sub '<<============= --- Regards, Norman "Avi" wrote in message ... Hello, Looking for a macro that selects a range from a portion of a row which is the Active Selection to the last non blank row bellow in the same columns as the Active Selection. The address of the current selection should be determined by VBA Thanks a lot Avi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
Help please in selecting range dependent on another range | Excel Programming | |||
Selecting a Range inside a range | Excel Programming | |||
Selecting a Range | Excel Programming |