Macro help

aholloway21

New Member
Joined
Apr 23, 2018
Messages
4
Hi All,

Would really appreciate some help if anyone can provide.
I'm not great with Excel but will try and explain as best as I can.

My spreadsheet is used for tracking "Jobs in progress", so it's a live summary of all work going through.
I have 3 sheets which are copies of each other, the first Active the second Completed, the third Dead.

They run from columns B-N. Column H contains a drop down selection for showing the stage of any job. What I am looking to do is when a certain option in that drop down is selected. For a specific example, "Completed". I then want all the data in that row to copy to the Compete sheet, and delete itself from the active sheet.
This would also then be replicated for the drop down option "Dead" to go to the sheet named Dead.

I hope I have explained this in a way that makes sense.



Thank you in advance.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi & welcome to MrExcel.
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

   If Target.CountLarge > 1 Then Exit Sub
   If Not Target.Column = 8 Then Exit Sub
Application.EnableEvents = False
   Select Case LCase(Target.Value)
      Case "completed"
         Target.EntireRow.Copy Sheets("Completed").Range("B" & Rows.Count).End(xlUp).Offset(1, -1)
         Target.EntireRow.Delete
      Case "dead"
         Target.EntireRow.Copy Sheets("Dead").Range("B" & Rows.Count).End(xlUp).Offset(1, -1)
         Target.EntireRow.Delete
   End Select
Application.EnableEvents = True
End Sub
This needs to go in the sheet module
 
Upvote 0
Hi & welcome to MrExcel.
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

   If Target.CountLarge > 1 Then Exit Sub
   If Not Target.Column = 8 Then Exit Sub
Application.EnableEvents = False
   Select Case LCase(Target.Value)
      Case "completed"
         Target.EntireRow.Copy Sheets("Completed").Range("B" & Rows.Count).End(xlUp).Offset(1, -1)
         Target.EntireRow.Delete
      Case "dead"
         Target.EntireRow.Copy Sheets("Dead").Range("B" & Rows.Count).End(xlUp).Offset(1, -1)
         Target.EntireRow.Delete
   End Select
Application.EnableEvents = True
End Sub
This needs to go in the sheet module

Thank you very much for the quick response. However, it doesn't seem to be working. Unless I am being dense with setting it up, which I think I have done correctly.
 
Upvote 0
Did you put it in the "Jobs in progress" sheet module.
Right click on the sheet tab > View Code. Is the code in the window that opens up?
Also are your Drop downs data validation drop downs?
 
Upvote 0
Did you put it in the "Jobs in progress" sheet module.
Right click on the sheet tab > View Code. Is the code in the window that opens up?
Also are your Drop downs data validation drop downs?

They are validation drop downs.
If it helps, here is a screen shot showing the code on the sheet module, maybe you can spot something I'm not seeing?
nDS9pH
 
Upvote 0
That seem to be in the right place.
Firstly run this
Code:
Sub Chk()
Application.EnableEvents = True
End Sub
Then try changing one of the dropdowns.
If that doesn't add this line of code as shown
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
[COLOR=#ff0000]Stop[/COLOR]
   If Target.CountLarge > 1 Then Exit Sub
and change a dropdown. Does the editor come up with the word Stop highlighted in yellow?
If Yes, then step through the code using F8 & see what happens.

I notice that you are on a Mac, which may be the problem as Macs don't have the full range of VBA
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

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