![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 1
|
I want to perform a simple task, within a macro.
I created a macro, that searches columns, for specific information. When that information is found, I want the entire row deleted. For example. My macro prompts the user to enter the data to search for. It then finds the data and then asks if they want that row deleted. How can I make the macro select the current row, that it found the data in. Thanks...in advance. Patch |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Patch
How about: Code:
Dim Rfound As Range
Dim strFind As String
On Error Resume Next
Set Rfound = Columns("B:B").Find(What:=strFind, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).EntireRow
If Not Rfound Is Nothing Then
Rfound.Select
Else
MsgBox "No Match"
End If
On Error GoTo 0
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|