hi, i am trying to test a cell in a row, other than the current column for a character length greater than 1. thanks.
i have some examples i have been trying to make work:
If Len(Cells(Target.Row, RANGE(H7).Column)) > 0 Then 'syntax error
'If Application.Len(Me.Cells(Target.Row, RANGE(H7).Column)) > 0 Then
'If Application.Len(Cells(ActiveCell.Row, H7)) > 1 Then
'If Len(Target) > 1 then 'rap
'If Len(RANGE(H7).Column) > 1 Then
'If Len(Cells(RANGE(H7))) > 1 Then
'If Me.Cells(Target.Row, H7).Value > 1 Then
MsgBox "YES"
Else
MsgBox "NO"
End If
example of a working similar item:
Dim J3 As String 'eg workcell shows: CY:CY
J3 = RANGE("J3") 'same for other work cells..
If Not Intersect(Me.RANGE(J3), .Cells) Is Nothing Then 'column select vb
If Me.Cells(Target.Row, J3).Value = "" Then '
Me.Cells(Target.Row, RANGE(J3).Column).Select 'jump
ElseIf Me.Cells(Target.Row, D2).Value = "" Then '
Me.Cells(Target.Row, RANGE(D2).Column).Select 'jump
Else
Me.Cells(Target.Row, RANGE(D2).Column).Select 'jump
End If
End If
========== ANSWER:
If Len(Cells(Target.Cells.Row, H7).Value) > 1 Then 'yes
'If Len(Cells(Target.Cells(2).Row, H7).Value) > 1 Then 'yes does same 1 row down test
'If Len(Cells(Target.Cells(2, 1).Row, H7).Value) > 1 Then 'yes, note: if correct: (rows, na cols?) offset inclusive/ +1
'If Len(Cells(Target.Cells(1, 1).Row, H7).Value) > 1 Then 'yes, not sure what 2nd digit is for
Me.Cells(Target.Row, RANGE(H7).Column).Select 'jump