#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default offset rows

I have selected row 7 and now I want to grow my selection to a variable
number of rows.... how do I do it.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default offset rows

Use Resize, not Offset...

Rows(7).Select
HowManyRows = InputBox("How many rows total did you want to select?")
Selection.Resize(HowManyRows).Select

--
Rick (MVP - Excel)


"Alberto Ast" wrote in message
...
I have selected row 7 and now I want to grow my selection to a variable
number of rows.... how do I do it.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default offset rows

Use,

Dim N As Long
N = 10
Selection.Resize(N).Select

This will resize the selection to N rows with the same number of
columns as the were in the original selection. It assumes N 0.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Sat, 17 Oct 2009 12:38:01 -0700, Alberto Ast
wrote:

I have selected row 7 and now I want to grow my selection to a variable
number of rows.... how do I do it.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default offset rows

Dim myRange as Range

Set myRange = Selection.resize(7,1) 'as an example

"Alberto Ast" wrote:

I have selected row 7 and now I want to grow my selection to a variable
number of rows.... how do I do it.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy offset rows JPreeshl Excel Discussion (Misc queries) 2 May 1st 10 03:56 AM
Offset function gives different answer in columns v Rows Jolly Excel Worksheet Functions 6 April 14th 09 05:45 PM
after a .Find command, offset the output 2 rows down. Ironhydroxide Excel Programming 7 January 6th 09 05:18 PM
Offset every # of Rows Javier Diaz[_2_] Excel Worksheet Functions 8 July 13th 07 06:08 PM
offset every other row down a column (2 merged rows) cj2k2k Excel Programming 1 July 4th 07 02:20 PM


All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"