Formula for 0

  • Thread starter Thread starter Fareez
  • Start date Start date
F

Fareez

Dear Friends
I want to find out 0 value and delete that columns say for ex
45862 0 46502 0 47449 0 48002 0
in this example i want to delete all columns which is 0 value.

thanks in advance
 
Hi,

1. Select the whole range
2. Press Ctrl+F enter 0 in the Find what box
3. Options, Match entire cell contents
4. Find All.
5. Select the first found entry
6. Scroll to the last fount value and hold down the Shft key and click it
(this selects all the 0 cells).
7. Click Close, and press Ctrl+- (control minus) and choose Entire column
 
Try the below macro. If you are new to macros set the Security level to
low/medium in (Tools|Macro|Security). From workbook launch VBE using
short-key Alt+F11. From menu 'Insert' a module and paste the below code.
Save. Get back to Workbook. Run macro from Tools|Macro|Run <selected macro()>

Sub DeleteEmptyColumns()
For lngCol = Cells(1, Columns.Count).End(xlToLeft).Column To 1 Step -1
'Hide rows with zeros and blanks
If WorksheetFunction.CountIf(Columns(lngCol), 0) + _
WorksheetFunction.CountBlank(Columns(lngCol)) = _
Rows.Count Then Columns(lngCol).Delete
Next
End Sub

If this post helps click Yes
 
Thanks for your reply. but it works only if it has been typed in column. but
my case is that amount is linked with other sheet.
 
Shane

A little trick to replace the Shift and scroll

6. hit CTRL + a to select all found 0 cells


Gord Dibben MS Excel MVP
 
Back
Top