Hi 
i have these two macros.. they work just like i need them to. But i would like to make them into one!
So that the message box shows when "X" entered. and then run the macro if Yes, and end Macro if No..
But when i put them together it goes into bug..
any ideas?
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Dim x As Integer
Dim y As Integer
Dim z As Integer
Dim i As Integer
i = Worksheets("Historik").Range("A1").CurrentRegion.Rows.Count
For x = 1 To 9999
If Cells(2 + x, 7) = "x" Then
z = z + 1
Worksheets("Historik").Cells(i + z, 1).Value = Cells(2 + x, 1)
Worksheets("Historik").Cells(i + z, 2).Value = Cells(2 + x, 2)
Worksheets("Historik").Cells(i + z, 3).Value = Cells(2 + x, 3)
Worksheets("Historik").Cells(i + z, 4).Value = Cells(2 + x, 4)
Worksheets("Historik").Cells(i + z, 5).Value = Cells(2 + x, 6)
End If
Next
Call UpdateAction
Application.ScreenUpdating = True
End Sub
Dim Msg As String, Ans As Variant
Msg = "Er du sikker på at du vil flytte denne til historik?"
Ans = MsgBox(Msg, vbYesNo)
Select Case Ans
Case vbYes
'the other code
Case vbNo
GoTo Quit:
End Select
Quit:
Bookmarks