Replace

  • Thread starter Thread starter esrei
  • Start date Start date
E

esrei

Please help

Header
RIG001515
JFK001695
FRA0018793
RIG001238
WIT0019602
VRE001228
STE00164
Header

If this is data in column A I need to replace all the
text that is not "Header" with text "Detail".
How do I do this without copping 2000 cells?
Thank you
 
Hi
I thought I already sent you a solution for that :-)
So you want to replace all text that is NOT Header with
the text 'Detail'. Try
Sub change_rows()
Dim RowNdx As Long
Dim LastRow As Long
Application.ScreenUpdating = False
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
with Cells(RowNdx, "A")
if .value <> "Header" and _
.value<>"" then
.value = "Detail"
End If
end with
Next RowNdx
Application.ScreenUpdating = True
End Sub
 

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