Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with row selection.


Anyone have an idea if this is possible

--
Drrott
-----------------------------------------------------------------------
Drrott1's Profile: http://www.excelforum.com/member.php...fo&userid=1546
View this thread: http://www.excelforum.com/showthread.php?threadid=27048

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with row selection.


Drrott1


set a variable with the row number that has the 1st occurance of yo
find text
eg rStart = 12

find last row that matches text

rLast = 20



use this code to copy & paste rows

Rows(rstart & ":" & rlast).Copy

rows(30).paste
or
sheets("sheet2").rows(1).past

--
mudrake
-----------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...nfo&userid=247
View this thread: http://www.excelforum.com/showthread.php?threadid=27048

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Help with row selection.

Drrott1 wrote in message ...
Anyone have an idea if this is possible?


Heres a piece of code that may help a bit - its by no means complete
- and im sure this could be done better

in particular it needs improved in two parts...

1. can anyone inform how to select the whole row of a current cell
the sub only copuies the cell

2. Im sure you can get cell.Address(....) to pass out the full address
i.e. including the worksheet - then you wont have to flick between
worksheets
as you loop through colFirstCellInRowAddress at the tail of the sub


Public Sub InputRoute()
Dim Route As Variant

Dim colFirstCellInRowAddress As New Collection

Columns("A:A").Select
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select

Route = InputBox("Please Enter route", "Route Selection")

For Each cell In Selection
If cell.Value = Route Then
colFirstCellInRowAddress.Add (cell.Address)
End If
Next cell

For Each obj In colFirstCellInRowAddress

ActiveSheet.Range(obj).Rows.Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Range(obj).Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Next obj

End Sub
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
Limiting selection in a cell AND linking that selection to a list Lisa Excel Discussion (Misc queries) 1 July 28th 09 05:00 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
limit cell list selection based on the selection of another list lorraine Excel Worksheet Functions 2 December 14th 04 08:17 PM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM


All times are GMT +1. The time now is 07:58 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"