Copy row if column contains specified number
Solved/Closed
Related:
- Copy row if column contains specified number
- Saints row 2 cheats - Guide
- How to delete a row in a table in word - Guide
- Saints row free download - Download - Action and adventure
- Tweetdeck remove column - Guide
- Vba last non empty row - Guide
2 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jun 23, 2010 at 09:57 AM
Jun 23, 2010 at 09:57 AM
Could you please upload a sample file with sample data, Macro, CONDITIONAL FORMAT formula etc on some shared site like https://authentification.site , http://wikisend.com/ ,https://accounts.google.com/ServiceLogin?passive=1209600&continue=https://docs.google.com/&followup=https://docs.google.com/&emr=1 http://www.editgrid.com etc and post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jun 25, 2010 at 03:49 PM
Jun 25, 2010 at 03:49 PM
Try this
Sub Button1_Click() Dim strsearch As String, lastline As Integer, tocopy As Integer Dim Cell As Range strsearch = CStr(InputBox("enter the string to search for")) lastline = Range("A65536").End(xlUp).Row Set Cell = Sheets("Sheet2").Cells.Find("*", Cells(1, 1), SearchOrder:=xlByRows, SearchDirection:=xlPrevious) If Cell Is Nothing Then j = 1 Else j = Cell.Row + 1 End If Set Cell = Nothing For i = 1 To lastline For Each c In Range("C" & i) If InStr(c.Text, strsearch) Then tocopy = 1 End If Next c If tocopy = 1 Then Rows(i).Copy Destination:=Sheets(2).Rows(j) j = j + 1 End If tocopy = 0 Next i End Sub
Jun 24, 2010 at 10:40 AM
in sheet2. It always pastes in row 1, overwriting previous paste
Sub Button1_Click()
Dim strsearch As String, lastline As Integer, tocopy As Integer
strsearch = CStr(InputBox("enter the string to search for"))
lastline = Range("A65536").End(xlUp).Row
j = 1
For i = 1 To lastline
For Each c In Range("C" & i)
If InStr(c.Text, strsearch) Then
tocopy = 1
End If
Next c
If tocopy = 1 Then
Rows(i).Copy Destination:=Sheets(2).Rows(j)
j = j + 1
End If
tocopy = 0
Next i
End Sub
help appreciated
Jun 24, 2010 at 06:18 PM
Jun 25, 2010 at 10:27 AM
Download link:
https://authentification.site/files/23128055/sample.xlsm
password:
sesefojicela
thanks vince harper