If you could post a sheet and explain what you want to do it would be better.
Generally it's better not to select cells, it's not necessary and this makes the code run much slower.
If you refer to specific sheets in your code then you can manipulate these cells without selecting them.
Small example below, but post a sheet give me some examples of things you would like to do and I will help you.
This will loop through the first 10 rows in the first column and add the value "Test" to all of them, it also sets the value in the cells 3 to the right to "New Test".
The sheet doesn't have to be selected, nor do the cells.
All of this is done on a sheet with the tab name of "One".
I guess I should specify. If you refer to the sheet specifically you don't have to be on that sheet. If you don't refer to a sheet specifically the code will run on the cells in the currently active sheet, which might be okay, but if you or someone else runs the code and forget to switch to the sheet you want the code to manipulate you will have undesirable results.
Referring to activecell can also cause issues if you activate the wrong cell or forget to activate the desired cell before starting the code.
Sub Example()
Dim wsOne As Worksheet
Dim r As Long
Set wsOne = Worksheets("One")
For r = 1 To 10
With wsOne
.Cells(r, 1).Value = "Test"
.Cells(r, 1).Offset(, 3).Value = "New Test"
End With
Next r
End Sub
Bookmarks