Formula for 0


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
 
Ad

Advertisements

S

Shane Devenshire

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
 
J

Jacob Skaria

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
 
F

Fareez

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.
 
Ad

Advertisements

G

Gord Dibben

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top