Dear all
I am creating a complaints DB in Excel and would l like some VBA.
Database Tab
I would like that when the user enters a "Closure Date" col AA10:AA107, this automaticaly populates the "Status" col F10:F107 as closed. The Status col contains a DV List otherwise i'd use an if statment.
If this is too tricky then i was thinking of -- if a date value is entered in cells AA10:AA107 then having a msg box with a reminder to change the status.
I have found some code which i am trying to tinker with...
Any help appreciated.Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim rng As Range Set rng = Range("AA10:AA107") If Not Intersect(Target, rng) Is Nothing Then If rng = "HOW DO I PUT ANY VALUE HERE" Then MsgBox "Cell " & _ rng.Address & " = PLEASE remember to change the complaint status to CLOSED" End If End If Set rng = Nothing End Sub
Last edited by Blake 7; 02-13-2012 at 08:55 AM.
Blake 7
If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.
http://failblog.org/
Try:
Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim rng As Range Dim rCell As Range Set rng = Range("AA10:AA107") If Not Intersect(Target, rng) Is Nothing Then For Each rCell In Intersect(Target, rng).Cells If Len(rCell.Value) > 0 Then MsgBox "Cell " & _ rCell.Address & " = PLEASE remember to change the complaint status to CLOSED" ' OR USE ' Application.enableevents = false ' Cells(rcell.row, "F").Value = "Closed" ' Application.enableevents = true End If Next rCell End If Set rng = Nothing End Sub
Good luck.
Hi R - thanks v much for responding.
I inserted the above code and voila, the msg box worked perfectly. Thanks
Regarding
' OR USE
' Application.enableevents = false
' Cells(rcell.row, "F").Value = "Closed"
' Application.enableevents = true
Please forgive me but could you explain further how to use this code?
Thanks v much
Blake 7
If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.
http://failblog.org/
Just uncomment it and comment out your message box line. I just put it there to give you the option to autopopulate the Closed bit.
Good luck.
many thanks. Perfect
Blake 7
If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.
http://failblog.org/
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks