Configuration: Windows XP Internet Explorer 6.0
|
Something like this:
Sub MvColumn() If Range("E1") = 1 Then Columns("E:E").Select Selection.Cut Sheets("Sheet2").Select Columns("E:E").Select ActiveSheet.Paste End If End Sub |
|
If you avoid "selecting" items in VBA before performing an action on them, your code will typically run faster and be easier to follow. For example, the code above can be condensed down to a single line.
Sub MvColumn1() If Sheets("Sheet1").Range("E1") = 1 Then Columns("E:E").Cut Destination:=Sheets("Sheet2").Range("E1") End Sub |
Résultats pour Excel Macro; move row os x 10.4.8
Résultats pour Excel Macro; move row os x 10.4.8
Résultats pour Excel Macro; move row os x 10.4.8
Résultats pour Excel Macro; move row os x 10.4.8
Résultats pour Excel Macro; move row os x 10.4.8