Automate Duplicating a Row based on Cell Value

dolphin34

New Member
Joined
Jan 24, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Web
Hi guys,

I have:

Col 1 Col 2 Col 3
A no
B yes
C no

I need the row to automatically duplicate whenever the value in column 3 is set to “yes”; so as soon as yes is put into the cell manually, it will result in the following:

Col 1 Col 2 Col 3
A no
B yes
B
C no


The idea seems easy to automate in my head; however, I am yet to find an appropriate solution. Is this possible or am I wasting my time here?

Thanks for your input

EDIT: Apologies for the formatting. The no yes should be under Column 3.
 
Last edited by a moderator:

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Like this?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Not Intersect(Target, Columns("C")) Is Nothing Then
  Application.EnableEvents = False
    If UCase(Target.Value) = "YES" Then
      Target.EntireRow.Copy
      Target.Offset(1).EntireRow.Insert
    End If
    Application.EnableEvents = True
  End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

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