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

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
@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,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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