Putting a text only if nothing follows to a specific word using VBA Excel

Status
Not open for further replies.

jamongkim

New Member
Joined
Sep 29, 2017
Messages
7
https://ibb.co/gqQ2Ow

Please see my captured result of the code I came up, I want the results to be just the second encircled one. I don't need to add epoxy if there is already a word after trimform which is like the first encirled one. Pls help me. TIA! :smile:



Below is my code i came up pls help! :)
Sub try()
Dim c As Range
For Each c In Range("D2:D429")
If c.Value = "TRIMFORM" Then
c.Offset(1, 0).EntireRow.Insert
c.Offset(1, 0).Value = "Epoxy"
End If
Next c
End Sub
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top