What is wrong with "c.Activate"

A

Ayo

For Each c In Worksheets("RFDS Tracker").Range("A4:A" & lastRow).Cells
If c.Value <> "" Then
c.Activate
 
J

Jon Peltier

Is the worksheet active?

Can you do whatever you need to without activating each cell? Activating
takes time and causes flashing of the screen while the code is running.

- Jon
 
A

Ayo

I need to use "active_cell = Application.ActiveCell.Address" and a lot of
code lines like this
"Worksheets(1).Range("D15").Value =
Application.ActiveCell.EntireRow.Cells(1, 17).Value"
that is why I figured I need to activate the cell
 
J

Joel

with Worksheets(1)
set MyRange = .Range(.Cells(c.row,"A"),.Cells(c.row,17))
MyRange.Copy Destination:=.Range("D15")
end with
 
J

Jon Peltier

As Joel indicates, you can rewrite your code to eliminate "ActiveCell". The
only reason you may need to reference the Active Cell is in an application
where the user's selection of a particular cell influences the operation of
the procedure.

- Jon
 
Top