Name range down one cell
Works!!!!!!!!!!!!!!
Private Sub UserForm_Activate()
With Worksheets("Matl Form")
If Application.CountA(.Range("plt_1001").Offset(-3, 0)) = 0 Then
Range("Plt_1001").Select
Else
Call Plt_1001_remove
End If
End With
End Sub
"Dave Peterson" wrote:
Since PLT_1001 is multiple cells, you can't compare the .value with a single
value.
But you could do:
with worksheets("somesheetnamehere")
if application.counta(.range("plt_1001").offset(1,0)) = 0 then
'the row under the single row, but multiple columns is empty
else
'there's something in at least one of the cells
end if
end with
If that PLT_1001 range is multiple rows, multiple columns and/or multiple areas,
you'll have to give more information on what should be checked...
tpeter wrote:
Jacob,
Thank you for your help. When I attempt to run it, it will still not work
(getting error). I am attempting to look at the cell below range "Plt_1001"
and if it is blank then bring up a user form to insert rows, if it is not
blank delete all but one row ("Plt_1001"). Everything works except for my
ability to refer to the cell below the named range ( c:w). I hope this
clarifies a little better than before. I have to refer to the name range
because there may be 1000 rows above it or 5 this is a variable.
"Jacob Skaria" wrote:
Try the below
If Range("Plt_1001").Offset(1) = "" Then
MsgBox "cell blank"
End If
If this post helps click Yes
---------------
Jacob Skaria
"tpeter" wrote:
I am building an if statement to check and see if the cell under Plt_1001
name range is blank. How do you refer to this? Thank you for your help again.
Private Sub UserForm_Activate()
Range("Plt_1001").Select
If Range("Plt_1001") -1.value = "" Then ' Doesn't work
Range("Plt_1001").Select
Else
Call Plant_1001
End If
End Sub
--
Dave Peterson
.
|