Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try the below
Sub Macro() Dim lngCol As Long, lngLastCol As Long lngLastCol = ActiveSheet.Cells.Find(What:="*", _ SearchDirection:=xlPrevious, SearchOrder:=xlByColumns).Column For lngCol = lngLastCol To 2 Step -1 If WorksheetFunction.CountIf(Columns(lngCol), "0") = 0 Then Columns(lngCol).ClearContents End If Next End Sub -- Jacob "Rupster" wrote: I have the following layout for several tabs. Mar-08 $0 $336 $4,808 $2036 $0 $0 $0 Apr-08 $0 $300 $130 $$0 $0 $0 May-08 $275 $433 $$0 $0 Jun-08 $25 $0 $0 Jul-08 $624 Each month data gets updated and the zeros all move one column to the right. I want to delete all the zeros after the cell containing a number. In the above example I want to delete all zeros after $2,036 in row 1.Is there a way I can delete them automatically without having to do it manually each month. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ADD A BUTTON TO A CELL TO DELETE A RANGE OF CELLS? | Excel Discussion (Misc queries) | |||
Delete cell shifts cells up - How to avaoid happening | Excel Discussion (Misc queries) | |||
Delete record(s) in other cells based on value of one cell. | Excel Discussion (Misc queries) | |||
Delete/clear a cell based on another cells contents | Excel Programming | |||
How do you delete one cell from a range of protected cells | Excel Worksheet Functions |