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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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