Thread: Improve code
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gareth gareth is offline
external usenet poster
 
Posts: 37
Default Improve code

There must be a better/quicker way of putting an R in
column L if column B has a 1 in it, at the moment I have
the following:

Sub Macro1()
Dim cell As Range
For Each cell In Range("B2:B" & Range("B65536").End
(xlUp).Row)
If cell.Value = 1 Then
cell.Offset(0, 10).Value = "R"
End If
Next cell
End Sub

The sheet may have several thousand rows.

TIA.

Gareth