![]() |
Copy headin
I have a code that replaces anything in the column with a "+" with the column
heading name, however I cannot get the code to move to the next column and do the same thing. Can anyone help Sub InsertRow() Application.ScreenUpdating = False lrow = Range("A" & Rows.Count).End(xlUp).Row For i = lrow To 2 Step -1 c = 12 If Cells(i, c).Value Like "*+*" Then Cells(i, c).Value = Cells(1, c) Next i End Sub |
Copy headin
'Try this:
Sub InsertRow() Application.ScreenUpdating = False 'How many columns to look at? For x = 1 To 25 Step 1 lrow = Cells(Rows.Count, x).End(xlUp).Row For i = lrow To 2 Step -1 If Cells(i, x).Value Like "*+*" Then _ Cells(i, x).Value = Cells(1, x) Next i Next x End Sub -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "David T" wrote: I have a code that replaces anything in the column with a "+" with the column heading name, however I cannot get the code to move to the next column and do the same thing. Can anyone help Sub InsertRow() Application.ScreenUpdating = False lrow = Range("A" & Rows.Count).End(xlUp).Row For i = lrow To 2 Step -1 c = 12 If Cells(i, c).Value Like "*+*" Then Cells(i, c).Value = Cells(1, c) Next i End Sub |
All times are GMT +1. The time now is 07:33 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com