Function func32655135_1(a As Range) As Integer
Dim starting_row, final_row, starting_column, final_column, i, j, signum, s As Integer
starting_row = a.Row
final_row = starting_row + a.Rows.Count - 1
starting_column = a.Column
final_column = starting_column + a.Columns.Count - 1
s = 0
For i = starting_row To final_row
signum = 1
For j = starting_column To final_column
signum = signum * Abs(Sgn(Cells(i, j)))
Next
s = s + signum
func32655135_1 = a.Rows.Count - s
End Function
Function func32655135_2(a As Range) As String
Dim starting_row, starting_column, i, j, yes_no As Integer
Dim answer(2) As String, r As Range
answer(0) = "No": answer(1) = "Yes"
For Each r In a
i = r.Row - starting_row + 1
j = r.Column - starting_column + 1
If j >= i Then GoTo label1
yes_no = (1 - Sgn(r.Value)) \ 2
If yes_no Then Exit For
label1:
func32655135_2 = answer(yes_no)
Function func32655135_3(a As Range, b As Integer) As String
Dim answer(2) As String
yes_no = 1 - Abs(Sgn(b - Application.max(Range(Cells(starting_row, j), Cells(final_row, j)))))
func32655135_3 = answer(yes_no)
Excel VBA
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Function func32655135_1(a As Range) As Integer
Dim starting_row, final_row, starting_column, final_column, i, j, signum, s As Integer
starting_row = a.Row
final_row = starting_row + a.Rows.Count - 1
starting_column = a.Column
final_column = starting_column + a.Columns.Count - 1
s = 0
For i = starting_row To final_row
signum = 1
For j = starting_column To final_column
signum = signum * Abs(Sgn(Cells(i, j)))
Next
s = s + signum
Next
func32655135_1 = a.Rows.Count - s
End Function
Function func32655135_2(a As Range) As String
Dim starting_row, starting_column, i, j, yes_no As Integer
Dim answer(2) As String, r As Range
answer(0) = "No": answer(1) = "Yes"
starting_row = a.Row
starting_column = a.Column
For Each r In a
i = r.Row - starting_row + 1
j = r.Column - starting_column + 1
If j >= i Then GoTo label1
yes_no = (1 - Sgn(r.Value)) \ 2
If yes_no Then Exit For
label1:
Next
func32655135_2 = answer(yes_no)
End Function
Function func32655135_3(a As Range, b As Integer) As String
Dim starting_row, final_row, starting_column, final_column, i, j, signum, s As Integer
Dim answer(2) As String
answer(0) = "No": answer(1) = "Yes"
starting_row = a.Row
final_row = starting_row + a.Rows.Count - 1
starting_column = a.Column
final_column = starting_column + a.Columns.Count - 1
For j = starting_column To final_column
yes_no = 1 - Abs(Sgn(b - Application.max(Range(Cells(starting_row, j), Cells(final_row, j)))))
If yes_no Then Exit For
Next
func32655135_3 = answer(yes_no)
End Function
Excel VBA