Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default macro error "no object"

I am trying to make a macro that deletes entire rows if in column 70 it does
not say "Manufacturer". I have created one that I think should work, however
it says error 424 object required and it does not say where. Any suggestions?
This is the macro:

Sub ManufacturingMacro( )

Dim Variable
Dim x ' Delete all non-manufacturing companies
x = 1
Do While Cells(x, 70).Value < ""
x = x + 1
Set Variable = Cells(x, 1)
If Variable.Value < "Manufacturer" Then
EntireRow.Delete
End If
Loop

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default macro error "no object"

It wants to know where the row to delete is.

Variable.EntireRow.Delete

" wrote:

I am trying to make a macro that deletes entire rows if in column 70 it does
not say "Manufacturer". I have created one that I think should work, however
it says error 424 object required and it does not say where. Any suggestions?
This is the macro:

Sub ManufacturingMacro( )

Dim Variable
Dim x ' Delete all non-manufacturing companies
x = 1
Do While Cells(x, 70).Value < ""
x = x + 1
Set Variable = Cells(x, 1)
If Variable.Value < "Manufacturer" Then
EntireRow.Delete
End If
Loop

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default macro error "no object"

Try the following code:

Sub AAA()
Dim LastRow As Long
Dim RowNdx As Long
With Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If StrComp(.Cells(RowNdx, 70).Text, _
"manufacturer", vbTextCompare) < 0 Then
.Rows(RowNdx).Delete
End If
Next RowNdx
End With
End Sub

This goes from the last non-blank cell in column A to row 1, testing
column 70, deleting the row if col 70 < "manufacturer".

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Mon, 16 Feb 2009 12:58:01 -0800,
m wrote:

I am trying to make a macro that deletes entire rows if in column 70 it does
not say "Manufacturer". I have created one that I think should work, however
it says error 424 object required and it does not say where. Any suggestions?
This is the macro:

Sub ManufacturingMacro( )

Dim Variable
Dim x ' Delete all non-manufacturing companies
x = 1
Do While Cells(x, 70).Value < ""
x = x + 1
Set Variable = Cells(x, 1)
If Variable.Value < "Manufacturer" Then
EntireRow.Delete
End If
Loop

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default macro error "no object"

Public Sub DelManufact()
Dim intNum, intRows As Integer
Dim strMan, strTest As String
Dim a
Application.ScreenUpdating = False
strMan = ""
strTest = ""
intNum = 0
intRows = 0

Range("A1").Select
Set a = Selection

strMan = UCase("manufacture")

Range(a, a.SpecialCells(xlLastCell)).Select
intRows = Selection.Rows.Count
For intNum = 0 To intRows

'use .Text in case the word is a formula type
strTest = UCase(ActiveCell.Offset(0, 0).Text)

If strMan = strTest Then
Rows(intNum).EntireRow.Delete 'shift:=xlUp

'If you delete a row you have to account for it in the toal rows already
determined.
intRows = intRows - 1
ActiveCell.Offset(0, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If

Next
End Sub

" wrote:

I am trying to make a macro that deletes entire rows if in column 70 it does
not say "Manufacturer". I have created one that I think should work, however
it says error 424 object required and it does not say where. Any suggestions?
This is the macro:

Sub ManufacturingMacro( )

Dim Variable
Dim x ' Delete all non-manufacturing companies
x = 1
Do While Cells(x, 70).Value < ""
x = x + 1
Set Variable = Cells(x, 1)
If Variable.Value < "Manufacturer" Then
EntireRow.Delete
End If
Loop

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
Error Help - Method "Range" of object "_Worksheet" failed. Alan Smith Excel Programming 3 March 15th 07 06:55 PM
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM
Error in Macro: "Method 'Paste' of object '_Worksheet' failed" blork Excel Programming 7 March 5th 06 05:48 PM
What is Error "Method "Paste" of object "_Worksheet" failed? vat Excel Programming 7 February 17th 06 08:05 PM
"Clean Me" Macro is giving "#VALUE!" error in the Notes field. Ryan Watkins Excel Programming 1 June 11th 05 12:25 AM


All times are GMT +1. The time now is 09:53 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"