Thread: row selecting
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
climate climate is offline
external usenet poster
 
Posts: 91
Default row selecting

Hi Rick
Your macro works correctly, thank's for your help.
best regards

"Rick Rothstein" wrote:

If I understand you correctly, you want to specify a number that can be
found in Column H and copy its entire row from Sheet1 (you didn't specify
this sheet name, so I guessed it) to Sheet2. If so, give this a try...

Sub CopyRow()
Dim Answer As String
Dim LastRowOnSheet2 As Long
With Worksheets("Sheet2")
LastRowOnSheet2 = .Cells(.Rows.Count, "A").End(xlUp).Row
If LastRowOnSheet2 = 1 And .Cells(1, "A").Value = "" Then
LastRowOnSheet2 = 0
End If
Answer = InputBox("Find which number in Row H and copy it?")
Worksheets("Sheet1").Columns("H").Find(Answer).Ent ireRow. _
Copy .Range("A" & (LastRowOnSheet2 + 1))
End With
End Sub

--
Rick (MVP - Excel)


"climate" wrote in message
...
Hi
I have a matrix (1000 * 60), and column H is numbered 1 to 1000
irregularly.
I want to try copy and extract row for example number700 to sheet2 when i
select number of that row.in fact when i enter number of any rows, a
formula
or macro copy entire of its row to sheet2.
Thank's and regards