LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default selecting rows using a variable.

I have this code...
Dim x1 As Integer
Dim x2 As Integer
Dim x3 As Integer
Columns("B:B").Select

Selection.Find(What:="miscellaneous", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
x1 = ActiveCell.Row
Columns("A:A").Select

Selection.Find(What:="ms totals", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
x2 = ActiveCell.Row
x3 = (x1:x2)

Rows(x3).Select

With this I am attempting to extract a few rows. I search for
"Miscellaneous" in column B, save the row number as x1. Search for "ms
totals" in column A, saving the row number as x2. All I want to do is Select
the Rows between those two numbers, seems easy probably is. I will be very
grateful to anyone who can help me at all, thanks a lot.
Nick Cherry
 
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
selecting variable rows in a macro that creates a pivot table amarch00 Excel Programming 1 May 12th 05 03:43 PM
selecting range of cells - variable # of rows [email protected] Excel Programming 6 April 15th 05 02:10 PM
Selecting Variable Rows Matt D. Excel Programming 3 June 18th 04 07:22 PM
Selecting a row with a variable ? Blewyn[_6_] Excel Programming 3 April 20th 04 08:16 AM
Selecting rows with variable Jim[_24_] Excel Programming 7 September 16th 03 02:03 PM


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

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

About Us

"It's about Microsoft Excel"