Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ryll
There are a few ways to do this. The method here assumes you have headings in row 1 and that the Fruits (or whatever you are looking for) are in column A. Sub fin() Dim fnd As String Dim fndRng As Range Dim eRow As Long Dim lRow As Long lRow = Sheets("Sheet1").Cells(Rows.Count, 1). _ End(xlUp).Row fnd = InputBox("Enter a Fruit") If fnd < "" Then With Sheets("Sheet1").Cells(1) .AutoFilter Field:=1, Criteria1:=fnd Set fndRng = Rows("2:" & lRow). _ SpecialCells(xlCellTypeVisible) .AutoFilter End With If Not fndRng Is Nothing Then eRow = Sheets("Sheet2").Cells(Rows.Count, 1). _ End(xlUp).Row + 1 fndRng.Copy Sheets("Sheet2").Cells(eRow, 1) End If End If End Sub Regards Rowan ryll wrote: hey thanks! your solution definitely helps. However as i've tried, it could only select a row of eg. Orange. If I had plenty rows under the fruit named Orange, how can i possibly do so? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IME MODE FOR EXCEL 2007 (URGENT URGENT) | Excel Discussion (Misc queries) | |||
Please help very urgent | Excel Discussion (Misc queries) | |||
Urgent-Urgent VBA LOOP | Excel Discussion (Misc queries) | |||
Macro help urgent urgent | Excel Programming | |||
Macro help urgent urgent | Excel Programming |