Hi,
I am hoping that someone may be able to help me with this problem which i will try to outline as clearly as possible.
I have an excel spreadsheet with over 250 rows in it (with more being added regularly). It is essentially being used as a calculator, the idea being if i put a quantity value in column B it would tell me how much they are worth, i could then do this for a number of rows and it would give me a value for each line as well as a total for all rows.
I then want to print only the lines which had a value in column B.
I then googled and found a macro which would allow me to do this (I have no real VB knowledge), the macro is as follows:
Sub PrintActiveLines()
Application.ScreenUpdating = False
Range("B:B").EntireRow.Hidden = False
Range("B:B").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("B:B").EntireRow.Hidden = False
Application.ScreenUpdating = True
End Sub
This was working perfectly until I added some formulas into column B in some rows, (like "=B30*2") which meant that if there was no value in cell B30 then the total for the formula is 0.
This means that all rows with a formula in it has a default value of 0 which then prints, but i don't want it to.
So what i am asking (in a long winded way) is how do i modify the formula so that only prints rows that has a value in Column B greater than zero. (or alternatively, I believe the formula above says "do not print row if column B is empty, how do i modify it so it says "do not print rows if column B is empty or equals zero")
I hope this all makes sense, This is a first time post ever, if i am unclear please be gentle with me.
Bookmarks