Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob
Sorry about that. Try this Sub User_Delete() Dim shDet As Worksheet Dim rngUN As Range Dim FndRng As Range Dim UserNo As Range Set UserNo = ThisWorkbook.Sheets("user deletion").Range("b2") If Not IsEmpty(UserNo) Then Set shDet = ThisWorkbook.Sheets("user details") Set rngUN = shDet.Range("a2", shDet.Range("A65536").End(xlUp)) Set FndRng = rngUN.Find(UserNo.Value, , , xlWhole) If FndRng Is Nothing Then MsgBox "User " & UserNo.Value & " not found" Else FndRng.EntireRow.Delete End If End If End Sub -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Bob" wrote in message ... help me again i type in the code Sub User_Delete() Dim shDet As Worksheet Dim rngUN As Range Dim FndRng As Range If Target.Address = "$B$2" Then Set shDet = Book1.Parent.Sheets("user details") Set rngUN = shDet.Range("a2", shDet.Range("A65536").End(xlUp)) Set FndRng = rngUN.Find(Target.Value, , , xlWhole) If FndRng Is Nothing Then MsgBox "User " & Target.Value & " not found" Else FndRng.EntireRow.Delete End If End If End Sub Then it says there is an error with If target.Address= "$b$2" Then HHHHHHHEEEEEEELLLPPPP MEEEEE I'M A NEWBIE! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula to Delete Duplicates but keep one record | Excel Discussion (Misc queries) | |||
macro Excel problem link cells with Data-Validation option | Excel Discussion (Misc queries) | |||
find last record in macro and delete all after | Excel Discussion (Misc queries) | |||
How to delete duplicated records. Each record has four lines | Excel Discussion (Misc queries) | |||
delete record using Macro in excel spreed sheet | Excel Programming |