Shatners Bassoon
New Member
- Joined
- Oct 19, 2018
- Messages
- 3
Hi all,
new member with limited VBA knowledge I'm afraid. I have below code which works fine however I would like to
expand this to do the following: In column Q I have a drop down list with 3 options (say A, B and C) and if this cell is not populated, I want a message displayed to the user to please fill it in with A, B or C and the macro to stop (go back to status Open):
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 And (Target.Text) = "Resolved" Then
Dim rngCell As Range
Dim rngDest As Range
Dim strRowAddr As String
'save target row address
strRowAddr = Target.Address
'find next row in destination worksheet
Set rngDest = Worksheets("Closed Issues"). _
Range("A" & CStr(Application.Rows.Count)).End(xlUp).Offset(1, 0)
Target.Offset(, -2) = Now()
'cut the source row & paste to destination
Target.EntireRow.Cut Destination:=rngDest
'remove the cut/copy range marquee
Application.CutCopyMode = False
'delete the source row
Worksheets("TEE Pending Issues").Range(strRowAddr).EntireRow.Delete _
Shift:=xlUp
End If
End Sub
Appreciate any help I can get as I have looked all morning but could not find the solution.
new member with limited VBA knowledge I'm afraid. I have below code which works fine however I would like to
expand this to do the following: In column Q I have a drop down list with 3 options (say A, B and C) and if this cell is not populated, I want a message displayed to the user to please fill it in with A, B or C and the macro to stop (go back to status Open):
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 And (Target.Text) = "Resolved" Then
Dim rngCell As Range
Dim rngDest As Range
Dim strRowAddr As String
'save target row address
strRowAddr = Target.Address
'find next row in destination worksheet
Set rngDest = Worksheets("Closed Issues"). _
Range("A" & CStr(Application.Rows.Count)).End(xlUp).Offset(1, 0)
Target.Offset(, -2) = Now()
'cut the source row & paste to destination
Target.EntireRow.Cut Destination:=rngDest
'remove the cut/copy range marquee
Application.CutCopyMode = False
'delete the source row
Worksheets("TEE Pending Issues").Range(strRowAddr).EntireRow.Delete _
Shift:=xlUp
End If
End Sub
Appreciate any help I can get as I have looked all morning but could not find the solution.