View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default If column B not empty, value in column A = L

How about:

Sub gsnu()
dim r as range

Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1

For i = 5 To nLastRow
If IsEmpty(Cells(i, 2).Value) Then
Else
Cells(i, 1).Value = "L"
End If
Next
End Sub

--
Gary's Student


"Juan" wrote:

Hi there,
I'm trying to maybe modifying this code:
Dim i As Long
On Error Resume Next
For i = 1 To ActiveSheet.UsedRange.Rows.Count( Maybe change this to From
Range B5 to last cell where there is data)
If Cells(i, "B") = "" Then Change This Whats the syntax for Not empty?
Cells(i, "A").Value = "L"
End If
Next
So basically if there is data in Column B5, then put L in Column A.

Please advise
Thanks for any help
Juan