Help with look up and row paste

jedibrown

Board Regular
Joined
Oct 17, 2011
Messages
136
Hi,

Basically, I am creating some data and I am a bit stuck.

I would like to say:

If any cells in column c have the word "Giant" in it (there will be a sentance in each cell but I would like it to pick out the specific word) - Then please paste the whole line into sheet 2.

Is this possible?

Many thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi - Sorry me again.

Off the back of that very successful project yesterday - I have been asked to do another similar exercise.

I think the help you gave me yesterday just needs to be altered a bit but I am stuck at the 1st hurdle!

So I want it to do the same thing, pasting information into the next sheet but different criteria.

I want it to look for the word "request" in column C first off.

I then want it to paste all rows apart from the ones with the following in column G:

Complete
Rejected
Testing
Fixed
Signoff
Release

Please can you help me with this?

Many thanks
 
Upvote 0
This was my attempt but it's not pasting anything into the next sheet

Dim LR As Long, i As Long
Sheets("Sheet2").UsedRange.ClearContents
LR = Range("C" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If Not IsError(Range("C" & i)) Then
If LCase(Range("G" & i).Value) <> "complete" And _
LCase(Range("G" & i).Value) <> "rejected" And _
LCase(Range("G" & i).Value) <> "testing" And _
LCase(Range("G" & i).Value) <> "fixed" And _
LCase(Range("G" & i).Value) <> "SignOff" And _
LCase(Range("G" & i).Value) <> "release" And _
(InStr(LCase(Range("C" & i).Value), "Request") > 0) _
Then Rows(i).Copy Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
 
Upvote 0
Try

Code:
Private Sub CommandButton1_Click()
Dim LR As Long, i As Long
Sheets("Sheet2").UsedRange.ClearContents
LR = Range("C" & Rows.Count).End(xlUp).Row
For i = 1 To LR
    If Not IsError(Range("C" & i)) And Not IsError(Range("G" & i)) Then
        If LCase(Range("C" & i).Value) = "request" And _
        LCase(Range("G" & i).Value) <> "complete" And _
        LCase(Range("G" & i).Value) <> "rejected" And _
        LCase(Range("G" & i).Value) <> "testing" And _
        LCase(Range("G" & i).Value) <> "fixed" And _
        LCase(Range("G" & i).Value) <> "signoff" And _
        LCase(Range("G" & i).Value) <> "release" _
        Then Rows(i).Copy Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)
    End If
Next i
End Sub
 
Upvote 0
Perfect - Thank you.

Can you tell me where I went wrong please? Hopefully if I can understand, I can stop bothering you!

Thanks :)
 
Upvote 0
I have tried to change it so that I can use it for another thing too.

I want the same except it to go to sheet6 not sheet2 and it to look for incident, not requests in column c.

Private Sub CommandButton2_Click()
Dim LR As Long, i As Long
Sheets("sheet6").UsedRange.ClearContents
LR = Range("C" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If Not IsError(Range("C" & i)) And Not IsError(Range("G" & i)) Then
If LCase(Range("C" & i).Value) = "Incident" And _
LCase(Range("G" & i).Value) <> "complete" And _
LCase(Range("G" & i).Value) <> "rejected" And _
LCase(Range("G" & i).Value) <> "testing" And _
LCase(Range("G" & i).Value) <> "fixed" And _
LCase(Range("G" & i).Value) <> "signoff" And _
LCase(Range("G" & i).Value) <> "release" _
Then Rows(i).Copy Destination:=Sheets("sheet6").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next i
End Sub

I can't get it to paste the info in though - Any ideas?
 
Upvote 0
incident needs to be in lower case

If LCase(Range("C" & i).Value) = "incident" And _
 
Upvote 0
Sorry - just been asked if I can look for both incident and problem?

Can problem be added on please? Both in the same column.

You are such a star!
 
Upvote 0
Try

Code:
If (LCase(Range("C" & i).Value) = "incident" or LCase(Range("C" & i).Value) = "problem") And _
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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