参考:www.excelpx.com/thread-369641-1-1.html|请教如何将表格中A列包含指定内容的单元格右移一格
-------------------------------------------------------------
参考:https://zhidao.baidu.com/question/90476405.html
---------------------------------------------------------------------------
参考:http://club.excelhome.net/thread-1266969-1-1.html
参考:http://www.amhl.net/wenzhang/office/20101201/147568.html
--------------------------------------------------
代码:
Sub 上移()
On Error Resume Next
i = Selection.Rows.Count
Selection.Cut
Selection.Offset(-1, 0).Insert
Selection.Offset(-1, 0).Select
End Sub
Sub 下移()
On Error Resume Next
i = Selection.Rows.Count
Selection.Cut
Selection.Offset(i 1, 0).Insert
Selection.Offset(1, 0).Select
End Sub
Sub 左移()
On Error Resume Next
Selection.Cut
Selection.Offset(0, -1).Insert
Selection.Offset(0, -1).Select
End Sub
Sub 右移()
On Error Resume Next
i = Selection.Columns.Count
Selection.Cut
Selection.Offset(0, i 1).Insert
Selection.Offset(0, 1).Select
End Sub
------------------------------------------------
参考:
https://zhidao.baidu.com/question/529902589.html
--------------------------------------
Sub select_1()
Dim i As Integer
Dim rag As Range, rag1 As Range
Set rag = Selection
For i = 1 To rag.Range("A1").End(xlDown).Row
If Application.WorksheetFunction.CountIf(rag.Range(i & ":" & i), 1) > 0 Then
If rag1 Is Nothing Then
Set rag1 = rag.Range(i & ":" & i)
Else
Set rag1 = Union(rag1, rag.Range(i & ":" & i))
End If
End If
Next i
rag1.Select
End Sub
------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rng As Range
Set rng = UsedRange
If Target.Count > 1 Then
Set Target = Target.Cells(1)
End If
If Application.Intersect(Target, rng) Is Nothing Or Target.Value = "" Then Exit Sub
Dim c As Range
For Each ws In Worksheets
Set rng = ws.UsedRange
rng.Interior.ColorIndex = xlNone
For Each c In rng
If c.Value = Target.Value Then
c.Interior.ColorIndex = 28
End If
Next
Next
End Sub
参考:club.excelhome.net/thread-1233237-1-1.html