What is wrong with "c.Activate"

  • Thread starter Thread starter Ayo
  • Start date Start date
A

Ayo

For Each c In Worksheets("RFDS Tracker").Range("A4:A" & lastRow).Cells
If c.Value <> "" Then
c.Activate
 
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
 
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
 
with Worksheets(1)
set MyRange = .Range(.Cells(c.row,"A"),.Cells(c.row,17))
MyRange.Copy Destination:=.Range("D15")
end with
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top