Sub Lineups()
Dim rng As Range
Set rng = Range("E2:E1501")
Dim ac As Range
Set ac = Application.ActiveCell
rng.Find(what:=ac).Select
ac.Interior.Color = 65535
Range("A" & ActiveCell.Row).Resize(1, 9).Cut
ActiveWindow.ScrollRow = 1
Sheets("Lineups").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("Data").Select
End Sub
Sub cfps1()
Application.DisplayAlerts = False
Dim sht As Worksheet
Dim i, j As Integer
For i = 1 To 10000
If (Range("e" & i).Value = "") Then
If (Range("a" & (i + 1)).Value = "") Then
If (Range("b" & (i + 1)).Value <> "") Then
If (Range("c" & (i + 1)).Value = "") Then
Range("e" & i).Value = Range("b" & (i + 1)).Value
Rows(i + 1).Delete
End If
End If
End If
End If
Next
End Sub
Sub cfps2()
Application.DisplayAlerts = False
Dim sht As Worksheet
Dim i, j As Integer
For i = 1 To 1296
If (Range("e" & i).Value = Range("d" & (i + 1)).Value And Range("e" & i).Value <> "" And Range("d" & (i + 1)).Value <> "") Then
Range("e" & i).Value = Range("d" & (i)).Value
Range("d" & (i)).Value = ""
End If
Next
End Sub
Sub cfps3()
Application.DisplayAlerts = False
Dim sht As Worksheet
Dim i, j As Integer
For i = 1 To 1296
If (Range("a" & (i + 1)).Value = "") Then
If (Range("d" & (i + 1)).Value = "") Then
If (Range("e" & (i + 1)).Value = "") Then
Range("e" & i).Value = (Range("e" & i).Value) & (Range("b" & (i + 1)).Value) & (Range("c" & (i + 1)).Value)
Rows(i + 1).Delete
End If
End If
End If
Next
End Sub
Sub cfps4()
Application.DisplayAlerts = False
Dim sht As Worksheet
Dim i, j As Integer
For i = 1 To 290
If (Range("e" & (i)).Value = "") Then
Range("e" & i).Value = Range("d" & i).Value
Range("d" & i).Value = ""
End If
Next
End Sub
Sub cfps5()
Application.DisplayAlerts = False
Dim sht As Worksheet
Dim i, j As Integer
Dim first_row, last_row
Dim first_col, last_col
first_col = ActiveSheet.UsedRange.Column
last_col = first_col + ActiveSheet.UsedRange.Columns.Count - 1
first_row = ActiveSheet.UsedRange.Row
last_row = first_row + ActiveSheet.UsedRange.Rows.Count - 1
For i = 1 To last_row
If (Range("e" & (i)).Value = "") Then
Range("e" & i).Value = Range("d" & i).Value
Range("d" & i).Value = ""
End If
Next
End Sub
标签:Dim,VBA,End,Worksheet,EXCEL,Value,Application,Range From: https://www.cnblogs.com/xkdn/p/17144660.html