LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default copy row if contain keyword

Hi Everyone,

i am pretty sure this is an easy fix but i can't seem to figure it out. I
am trying to write the following: find the row that the date fall within
certain date and then within that row, look at cell column "E" and find a
keyword, then both conditions are met then copy the entire row into
sheets("Paste_results").

I am unable to get the "find the rows that the date fall within certain
dates" but I can't get the second part. I can't get it though the second if.
My code is below: (please help)

date1 = Me.StartDate.Value
date2 = Me.EndDate.Value
keyword = Me.Product.Value

With Worksheets("Complaint Log")
Set datecompRng = .Range("I2", .Cells(.Rows.Count, "I").End(xlUp))
Set DescripRng = .Range("E2", .Cells(.Rows.Count, "E").End(xlUp))
End With

Sheets("paste_results").Cells.Clear

For Each datecompRng In datecompRng.Cells
If datecompRng = date1 And datecompRng <= date2 Then
MsgBox "date between"
If Cells(datecompRng, "E").Value = "*keyword*" Then
MsgBox "contain word"
datecompRng.EntireRow.Copy
Sheets("paste_results").Select
Cells(Rows.Count, 1).End(xlUp)(2).Select
Selection.PasteSpecial Paste:=xlAll
'copy the row
'paste the row in sheet reports
End If
End If
Next datecompRng


thank you,
tracktraining

--
Learning
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
most popular keyword Tony_student[_2_] Excel Worksheet Functions 3 June 27th 09 07:19 AM
Keyword Gary''s Student Excel Programming 1 August 5th 06 03:11 PM
keyword search Doman Excel Discussion (Misc queries) 2 July 20th 06 01:30 PM
Sharing with Keyword Nam Excel Discussion (Misc queries) 0 April 28th 06 05:27 AM
SQL Keyword S Taylor[_2_] Excel Programming 2 October 6th 04 03:10 PM


All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"