Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Find something

I need to come up with a way to copy a cell in certain tab and then goto
another tab in the same workbook and perform a search function. Paste the
copied cell info in the find field and find the match. After it is found
close out the find dialog box and delete the entire row that returned a match.

this is what I have so far.

ActiveCell.Offset(0, -10).Range("A1").Select
Selection.Copy
Sheets("Current Month").Select
Range("H10").Select
Cells.Find(What:="211989", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
ActiveCell.Select
Sheets("Master Log 2008").Select
ActiveCell.Offset(0, -1).Range("A1").Select

The "Cells.Find(What:="211989"," is what is killing me. I don't know exactly
what that number is going to be based on the inforperformed above the start
of this code.

Is there a way to get around this or make the "What:" some sort of wild card
based on the users clipboard info within their mouse?

Any suggestions
thanks
Peter
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Find something

Peter,

No need to copy - this will work with the 10 column offset - might be better if you select the cell
with the value directly and remove the Offset(0,-10) part...

Sub DeleteMatch()
Sheets("Current Month").Cells.Find( _
What:=ActiveCell.Offset(0, -10).Value, _
LookIn:=xlFormulas, _
LookAt:=xlPart).EntireRow.Delete
End Sub

HTH,
Bernie
MS Excel MVP


"Looping through" wrote in message
...
I need to come up with a way to copy a cell in certain tab and then goto
another tab in the same workbook and perform a search function. Paste the
copied cell info in the find field and find the match. After it is found
close out the find dialog box and delete the entire row that returned a match.

this is what I have so far.

ActiveCell.Offset(0, -10).Range("A1").Select
Selection.Copy
Sheets("Current Month").Select
Range("H10").Select
Cells.Find(What:="211989", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
ActiveCell.Select
Sheets("Master Log 2008").Select
ActiveCell.Offset(0, -1).Range("A1").Select

The "Cells.Find(What:="211989"," is what is killing me. I don't know exactly
what that number is going to be based on the inforperformed above the start
of this code.

Is there a way to get around this or make the "What:" some sort of wild card
based on the users clipboard info within their mouse?

Any suggestions
thanks
Peter



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Find something

Thanks Bernie, This worked perfectly.

"Bernie Deitrick" wrote:

Peter,

No need to copy - this will work with the 10 column offset - might be better if you select the cell
with the value directly and remove the Offset(0,-10) part...

Sub DeleteMatch()
Sheets("Current Month").Cells.Find( _
What:=ActiveCell.Offset(0, -10).Value, _
LookIn:=xlFormulas, _
LookAt:=xlPart).EntireRow.Delete
End Sub

HTH,
Bernie
MS Excel MVP


"Looping through" wrote in message
...
I need to come up with a way to copy a cell in certain tab and then goto
another tab in the same workbook and perform a search function. Paste the
copied cell info in the find field and find the match. After it is found
close out the find dialog box and delete the entire row that returned a match.

this is what I have so far.

ActiveCell.Offset(0, -10).Range("A1").Select
Selection.Copy
Sheets("Current Month").Select
Range("H10").Select
Cells.Find(What:="211989", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
ActiveCell.Select
Sheets("Master Log 2008").Select
ActiveCell.Offset(0, -1).Range("A1").Select

The "Cells.Find(What:="211989"," is what is killing me. I don't know exactly
what that number is going to be based on the inforperformed above the start
of this code.

Is there a way to get around this or make the "What:" some sort of wild card
based on the users clipboard info within their mouse?

Any suggestions
thanks
Peter




Reply
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
Find and Replace - delete the remainder of the text in the cell after my Find [email protected] Excel Programming 4 August 4th 07 03:39 AM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Despite data existing in Excel 2002 spreadsheet Find doesn't find AnnieB Excel Discussion (Misc queries) 1 June 16th 06 02:15 AM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 12:20 PM.

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"