ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selection of variable rows (https://www.excelbanter.com/excel-programming/360953-selection-variable-rows.html)

Archie

Selection of variable rows
 
I need to select a range of rows in some data which can be variable.

How do you write in a macro to select say rows 1 to N, where the N is
dependent on other factors in the macro.

possible sublimely simple?!

[email protected]

Selection of variable rows
 
something like this do you?

Dim N As Long
N = 11
Rows("3:" & N).Select


[email protected]

Selection of variable rows
 
something like this do you?

Dim N As Long
N = 11
Rows("1:" & N).Select


Dana DeLouis

Selection of variable rows
 
How do you write in a macro to select say rows 1 to N ?

Sub Demo()
Dim n As Long
n = 5
Rows(1).Resize(n).Select
End Sub

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Archie" wrote in message
...
I need to select a range of rows in some data which can be variable.

How do you write in a macro to select say rows 1 to N, where the N is
dependent on other factors in the macro.

possible sublimely simple?!




Archie

Selection of variable rows
 
Great Thanks

" wrote:

something like this do you?

Dim N As Long
N = 11
Rows("3:" & N).Select



Archie

Selection of variable rows
 
great thanks

"Dana DeLouis" wrote:

How do you write in a macro to select say rows 1 to N ?


Sub Demo()
Dim n As Long
n = 5
Rows(1).Resize(n).Select
End Sub

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Archie" wrote in message
...
I need to select a range of rows in some data which can be variable.

How do you write in a macro to select say rows 1 to N, where the N is
dependent on other factors in the macro.

possible sublimely simple?!






All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com