خرید بک لینک

Vote count: 0

Looking to consolidate/combine the following code into one module/script. The "Erase" script should be executed first and then the "MoveData" would run:

Sub Erase()
'
' Erase Macro
' Erase Data
'
rspn = MsgBox("Are you Sure?", vbYesNo)
If rspn = vbNo Then Exit Sub
'code
'
ActiveWindow.SmallScroll Down:=-27
Range("N3:Y152").Select
Selection.ClearContents
Range("N3").Select
Range("N3:Y152").Interior.Color = xlNone

End Sub



Sub MoveData()
Dim vals As Range, val As Range, colOffset As Integer

Set vals = Range("K3:K" & Range("K3").End(xlDown).Row)

For Each val In vals
    If val > 0 Then
        colOffset = VBA.Month(val.Offset(0, 16))
        val.Offset(0, colOffset) = val
        val.Offset(0, colOffset + 1) = val.Offset(0, 1)
        val.Offset(0, colOffset + 2) = val.Offset(0, 2)
    End If
Next val
MsgBox "Operation Completed"
End Sub

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 17 فروردين 1395 ساعت: 8:36

صفحه بندی