VBA or Conditional Formatting to Insert a new row of data base on cell value.

raj_1026

New Member
Joined
Apr 11, 2018
Messages
4
Hey y'all. I've been scouring the internet to piece together codes that would be able to accomplish the task at hand.
I currently have a worksheet that has the names of clients (a), when their next meeting is (b), and was the meeting completed? (c).

I'm trying to make it so, once a meeting has been completed and the worker puts in the txt "Yes" a new row appears beneath the client, copying down the client name and adding 84 days the the cell above (in B). I've already tested a code that then moves the completed meeting to a new sheet.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Current Meeting Date[/TD]
[TD]Completed?[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]7/25/2018[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Morgan Freeman[/TD]
[TD]8/1/2018[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
   If Target.Column = 3 And LCase(Target.Value) = "yes" Then
      Application.EnableEvents = False
      Rows(Target.Row + 1).Insert
      Target.Offset(, -2).Resize(2).FillDown
      Target.Offset(1, -1).Value = Target.Offset(, -1).Value + 84
      Application.EnableEvents = True
   End If
End Sub
This needs to go in the sheet module
 
Upvote 0
Hey Fluff that code looks perfect.
I copied it to my sheet module and when I hit run the Macros window should up with the code that I have to move the row base on cell value. What am I doing wrong?
 
Upvote 0
You do not need to run that macro (it's event code).
It will run automatically whenever to type yes into col C
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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