Beginner Seeking Help

Viking1221

New Member
Joined
May 25, 2017
Messages
32
Hello,

I have a macro that use the autofilter function to find blanks and then deletes the rows. However, I am struggling with how to write a macro that will find the last column in row 10 and filter on zero and delete all 0's. Then after it executes this code, I want 'that' entire column deleted. Any ideas?

This is the code I have, but is specifically looks at Column C:

Sub DeleteRowsC()

Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Journals")
ws.Activate
On Error Resume Next
ws.ShowAllData
On Error GoTo 0

ws.Range("A10:BZ10000").AutoFilter Field:=3, Criteria1:=""

Application.DisplayAlerts = False
ws.Range("A10:BZ10000").SpecialCells(xlCellTypeVisible).Delete
Application.DisplayAlerts = True

On Error Resume Next
ws.ShowAllData
On Error GoTo 0

End Sub
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
@Viking1221
You didn't respond to the post from @JLGWhiz.....which to me, seems to be the easiest and simplest method


Code:
Sub t()
With ActiveSheet
    . Columns(.Cells(10, Columns.Count).End(xlToLeft).Column).Delete xlShiftLeft
End With
End Sub

I don't believe that the narrative in the OP was even near what the user really wanted, based on post #10 .
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top