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

Rookie he Not sure what I'm doing wrong. I get a Runtime error 424
Object required on the wp.Rows(fnd.Row).Delete statement. Can someone
tell how to fix this? Thanks Jody


Private Sub btnDelete_Click()
'Search all Cells on the sheet for Me.cboPolkInOldNotInNew.Text
Dim wp As Variant
Set wp = Worksheets("PolkToCpMap").Range("PolkToCpMapNames" )
fnd = wp.Find(Me.cboPolkInOldNotInNew.Text)
'The find function returns a Range if the text is found or Nothing if
it is not.
If fnd = "" Then
MsgBox "Text not Found"
Else
wp.Rows(fnd.Row).Delete
End If
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Runtime Error

Hi SS,

Try:

'==============
Private Sub btnDelete_Click()
Dim wp As Range
Dim fnd As Range

Set wp = Worksheets("PolkToCpMap"). _
Range("PolkToCpMapNames")

On Error Resume Next
fnd = wp.Find(Me.cboPolkInOldNotInNew.Text)
On Error GoTo 0

If fnd Is Nothing Then
MsgBox "Text not Found"
Else
wp.Rows(fnd.Row).Delete
End If

End Sub
'<<==============


---
Regards,
Norman



"ssjody" wrote in message
oups.com...
Rookie he Not sure what I'm doing wrong. I get a Runtime error 424
Object required on the wp.Rows(fnd.Row).Delete statement. Can someone
tell how to fix this? Thanks Jody


Private Sub btnDelete_Click()
'Search all Cells on the sheet for Me.cboPolkInOldNotInNew.Text
Dim wp As Variant
Set wp = Worksheets("PolkToCpMap").Range("PolkToCpMapNames" )
fnd = wp.Find(Me.cboPolkInOldNotInNew.Text)
'The find function returns a Range if the text is found or Nothing if
it is not.
If fnd = "" Then
MsgBox "Text not Found"
Else
wp.Rows(fnd.Row).Delete
End If
End Sub



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
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Interior class error/runtime error 1004 David Goodall Excel Programming 1 October 24th 04 10:16 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM
Unknown where is the problem on the Runtime error - Automation error wellie Excel Programming 1 July 10th 03 08:12 AM


All times are GMT +1. The time now is 05:57 PM.

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

About Us

"It's about Microsoft Excel"