nitrammada
Board Regular
- Joined
- Oct 10, 2018
- Messages
- 78
- Office Version
- 365
- Platform
- Windows
Hi Folks
I'm try to return a value to column B where if a cell in column Y (that has a formula in it) is <>0, then return "Y" on the same row in column B, else "N". Trouble is it sees the formula (=IFERROR(X8*W8,"")) as a value when in fact in some cases it is zero. I've been searching the FAQ's and from what I have read, it seems I have to Dim the range in column Y as Boolean and possibly set the range or something. Here's what I have so far but it doesn't work. I have several sheets to check and each sheet has a varying number of rows hence I'm using the row.count.end xlUp function.
If anyone can point me in the right direction I would be most grateful.
Kind regards
Adam
I'm try to return a value to column B where if a cell in column Y (that has a formula in it) is <>0, then return "Y" on the same row in column B, else "N". Trouble is it sees the formula (=IFERROR(X8*W8,"")) as a value when in fact in some cases it is zero. I've been searching the FAQ's and from what I have read, it seems I have to Dim the range in column Y as Boolean and possibly set the range or something. Here's what I have so far but it doesn't work. I have several sheets to check and each sheet has a varying number of rows hence I'm using the row.count.end xlUp function.
VBA Code:
Sub CheckCode3()
Application.ScreenUpdating = False
Dim Count, i As Long
Count = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
'MsgBox Count
i = 7
Do While i <= Count
If Cells(i, 25).Value <> 0 Then
Range(Cells(i, 2), Cells(i, 2)).Value = "Y"
ElseIf Cells(i, 25).Value = "" Then
Range(Cells(i, 2), Cells(i, 2)).Value = "N"
End If
i = i + 1
Loop
Application.ScreenUpdating = True
End Sub
If anyone can point me in the right direction I would be most grateful.
Kind regards
Adam
Last edited by a moderator: