Aretradeser
Board Regular
- Joined
- Jan 16, 2013
- Messages
- 176
- Office Version
- 2013
- Platform
- Windows
I use 2 codes that work perfectly separately; but when I join them, using the "Call" instruction, it doesn't work, and I don't understand why. So I ask you how to join these codes.
VBA Code:
'
Sub DeleteRows()
'Call IncluirDatosCopiadosCP ' It does not work
Application.ScreenUpdating = False
Dim rng As Range
Dim InputRng As Range
Dim DeleteRng As Range
Dim DeleteStr As String
xTitleId = "Eliminar Jubilados"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
DeleteStr = Application.InputBox("Delete Text", xTitleId, Type:=2)
For Each rng In InputRng
If rng.Value = DeleteStr Then
If DeleteRng Is Nothing Then
Set DeleteRng = rng
Else
Set DeleteRng = Application.Union(DeleteRng, rng)
End If
End If
Next
DeleteRng.EntireRow.Delete
Application.ScreenUpdating = True
End Sub
'
Sub IncluirDatosCopiadosCP()
Application.ScreenUpdating = False
Sheets("Delegacion").Select
Range("Delegados").Select
Selection.Copy
Sheets("DelegacionA").Select
Range("B2").Select
ActiveSheet.Paste
Application.ScreenUpdating = True
End Sub