ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba check cell value (https://www.excelbanter.com/excel-programming/427337-re-vba-check-cell-value.html)

Gary''s Student

vba check cell value
 
Say the possible zeros are in column A:

Sub StayHappy()
Dim n As Long
Dim i As Long
n = Cells(Rows.Count, "A").End(xlUp).Row
For i = n To 1 Step -1
If Cells(i, "A").Value = 0 Then
Rows(i).Delete
End If
Next
End Sub

--
Gary''s Student - gsnu200848


"Neil" wrote:

Hi
I have a work book with multiple worksheets.
Sheet 1 used for data entry, data is entered in several rows and each row is
then auto totalled.
The totals are then pasted into sheet 2 where further calculations are
applied.

When the totals are passed to sheet 2 I get a column of figures which could
contain zero values.
I am trying to write a routine to scan the list and to remove zero value
lines.
Is there a VBA function which will allow me to check if a cell contains a
zero value even though the cell contains a reference to a different worksheet?

Thanks




All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com