VBA

jdlerry

New Member
Joined
Apr 6, 2021
Messages
32
Office Version
  1. 2016
Platform
  1. Windows
Hello everyone, I need your help please. I just need VBA code to get my reports working. What I want to do is whenever these dropdowns are selected, it should automatically go to another sheet.

Completed: CCG Response
Completed: GSS Notification
Completed: IV Notification



Another VBA code that I need help of is whenever a dropdown is selected, it should go to the intended sheet. For example, I have a masterlist in sheet 1 which contains projects and from the dropdowns, I will select the name of the owner per project. Once selected, it should automatically move to the intended sheet. The difference with the first concern is the destination sheet. There will be multiple destination sheets which correspond the owner.

Thank you!
 
Okay, Thank you! Am I supposed to substitute any codes you provided to actual sheets? Sorry, I am just not sure how.
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Rich (BB code):
Am I supposed to substitute any codes you provided to actual sheets?
Sorry, I don't understand this request.....The code will go in the MasterSheet module
 
Upvote 0
Rich (BB code):
Am I supposed to substitute any codes you provided to actual sheets?
Sorry, I don't understand this request.....The code will go in the MasterSheet module
That's what I did here but not working.
 

Attachments

  • Capture.PNG
    Capture.PNG
    7.7 KB · Views: 3
Upvote 0
During this thread you haven't stated that you wanted the row copied to another sheet....You simply staed you want to go to the Complted Sheet.....Whole different story
Us this instead, In the Master Sheet module
VBA Code:
Private Sub worksheet_selectionChange(ByVal target As Range)
Dim lr As Long
If Not Intersect(target, Range("K:K")) Is Nothing Then
ans = Evaluate("Left(" & ActiveCell.Address & ",9)")
 lr = Sheets("Completed Cases").Cells(Rows.Count, "A").End(xlUp).Row
Application.EnableEvents = False
Rows(ActiveCell.Row).Copy Sheets(ans & " Cases").Range("A" & lr + 1)
End If
Application.EnableEvents = True
End Sub
 
Upvote 0
During this thread you haven't stated that you wanted the row copied to another sheet....You simply staed you want to go to the Complted Sheet.....Whole different story
Us this instead, In the Master Sheet module
VBA Code:
Private Sub worksheet_selectionChange(ByVal target As Range)
Dim lr As Long
If Not Intersect(target, Range("K:K")) Is Nothing Then
ans = Evaluate("Left(" & ActiveCell.Address & ",9)")
lr = Sheets("Completed Cases").Cells(Rows.Count, "A").End(xlUp).Row
Application.EnableEvents = False
Rows(ActiveCell.Row).Copy Sheets(ans & " Cases").Range("A" & lr + 1)
End If
Application.EnableEvents = True
End Sub
I really really appreciate all your help but I think it's not working. Thank you!
 

Attachments

  • Capture.PNG
    Capture.PNG
    18.8 KB · Views: 1
Upvote 0
Not working doesn't help me....Is there an error ?
At some point did you quir rhe code before it had completed ?
If so, you will probably find that Enableevents is still turned off....If so, In the VBA window press CTRL + G
In the window that appears, paste this line
VBA Code:
Application.EnableEvents = True
Then press Enter, try the worksheet again
 
Upvote 0
Also try it this way
VBA Code:
Private Sub worksheet_Change(ByVal target As Range)
Dim lr As Long
If Not Intersect(target, Range("K:K")) Is Nothing Then
ans = Evaluate("Left(" & ActiveCell.Address & ",9)")
 lr = Sheets("Completed Cases").Cells(Rows.Count, "A").End(xlUp).Row
Application.EnableEvents = False
Rows(ActiveCell.Row).Copy Sheets(ans & " Cases").Range("A" & lr + 1)
End If
Application.EnableEvents = True
End Sub
 
Upvote 0
Also try it this way
VBA Code:
Private Sub worksheet_Change(ByVal target As Range)
Dim lr As Long
If Not Intersect(target, Range("K:K")) Is Nothing Then
ans = Evaluate("Left(" & ActiveCell.Address & ",9)")
lr = Sheets("Completed Cases").Cells(Rows.Count, "A").End(xlUp).Row
Application.EnableEvents = False
Rows(ActiveCell.Row).Copy Sheets(ans & " Cases").Range("A" & lr + 1)
End If
Application.EnableEvents = True
End Sub
I think my challenge here is understanding how this whole thing works. I know it is too much but I need a specific instruction please. So I pasted the code in module and then what? Should I click anything (like F5?) after that or it will do its magic? It does not show me any error.
 
Upvote 0
No....if the code is pasted in the "MasterList" sheet module
THEN
if you make a change to any dropdown in column "K", that row should be pasted over to the"Completed Cases" Sheet on the lastrow + 1
If you are having further issues can you upload the workbook to DropBox, or similar hosting site, then post the link back here, so we can take a look at the problem
 
Upvote 0

Forum statistics

Threads
1,215,694
Messages
6,126,255
Members
449,306
Latest member
RealNinetyThree

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