Add text to Range of cells

  • Thread starter Thread starter jlclyde
  • Start date Start date
J

jlclyde

I have a range that I need to add the same text to if the cell is
visible. Is there a way to do this without putting in a loop? Here
is my code.

Thanks,
Jay
Set Rng = .AutoFilter.Range.Offset(1,
0).Resize(.AutoFilter.Range.Rows.Count - 1) _
.SpecialCells(xlCellTypeVisible)

If .Rows(.Rows.Count).Row <> 4 Then
Set Rng = .Range("A5:A" & Lstrow)
Set Rng = Rng.SpecialCells(xlCellTypeVisible)
Rng.Value = Rng.Value & "N"
End If
 
I have a range that I need to add the same text to if the cell is
visible.  Is there a way to do this without putting in a loop?  Here
is my code.

Thanks,
Jay
        Set Rng = .AutoFilter.Range.Offset(1,
0).Resize(.AutoFilter.Range.Rows.Count - 1) _
            .SpecialCells(xlCellTypeVisible)

            If .Rows(.Rows.Count).Row <> 4 Then
                Set Rng = .Range("A5:A" & Lstrow)
                Set Rng = Rng.SpecialCells(xlCellTypeVisible)
                Rng.Value = Rng.Value & "N"
            End If

If ?? every cell in the range ends with the same thing such as M then
columns(1).replace "M", "MN"
else loops shouldn't be too slow these days.
 
If ?? every cell in the range ends with the same thing such as M then
columns(1).replace "M", "MN"
else loops shouldn't be too slow these days.

All of the cells do not end with a specific value. Good thinking
though. I know the loop runs fast; I am just wonderign if there is a
way to avoid the loop. I already have several loops in this
subroutine and thought I woudl try to avoid another oner.

Thanks,
Jay
 
All of the cells do not end with a specific value.  Good thinking
though.  I know the loop runs fast; I am just wonderign if there is a
way to avoid the loop.  I already have several loops in this
subroutine and thought I woudl try to avoid another oner.

Thanks,
Jay
"If desired, send your file to dguillett @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
 
Back
Top