Hey guys,
i’ve got an vba script that checks for hidden rows in a sheet. The idea is that it then sets a string variable to “true” and i want to transfer that string to a variable in the project. I’m using this vba code:
Private Function ShowRows() as String
Dim rng As Range
Dim c As Range
Dim sTemp As String
Set rng = Range(“A1:A1000”)
sTemp = “”
For Each c In rng
If c.EntireRow.Hidden Then
sTemp = sTemp & "Row " & c.Row & vbCrLf
End If
Next cIf sTemp > "" Then sTemp = "True" Else sTemp = "There are no hidden rows" End If
ShowRows = Status
End Function
If i run it in excel it works fine. However i cant get it to transfer out into another variable.
Please see images below. I’ve tried setting the output variable as a string but it only accepts a object variable and the write line activity shows it as empty. What am i doing wrong?
Also, would it be possible to use a boolean variable right away instead of a string?