Most Urgent----CONVERT FORMULA INTO CODE

fari1

Active Member
Joined
May 29, 2011
Messages
362
Hi, i want to convert my below formula to code, which loop through entire column A and bring me those rows which contain 10-(along with there can be anything).
Code:
=INDEX($A$2:$A$401,MATCH("10-*",$A$2:$A$401,0))

urgent help is required
 
Irrespective of the sheet names, if the sheet number 1 and 2 (Serially in the workbook) is what you want to work on then:
Code:
Public Sub FindData()
Dim lLastRow As Long
With Sheets(1)
lLastRow = .Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To lLastRow
If InStr(1, .Range("A" & i).Value, "10-") > 0 Then
.Rows(i).Copy Destination:=Sheets(2).Range("A" & Rows.Count).End(xlUp)(2)
End If
Next i
Application.CutCopyMode = False
End With
End Sub
 
Last edited:
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
thats great kevin,u just came in and telling him about my qualities, gud,

It does help the replier great deal.
It's about who's new to VBA and who's not.

If the questioner has very little knowledge in VBA. the answerer cannot ask the questioner to replace X with Y.
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top