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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
@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,214,375
Messages
6,119,164
Members
448,870
Latest member
max_pedreira

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