关于EXCEL选定区域宏
Sub 脚本生成()'
' 脚本生成 Macro
'
'
Application.ScreenUpdating = False
Sheets("1X邻区").Select
Range("D3:D999").Select
Selection.Copy
Sheets("脚本生成").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1X邻区").Select
Range("H3:H999").Select
Selection.Copy
Sheets("脚本生成").Select
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1X邻区").Select
Range("M3:M999").Select
Selection.Copy
Sheets("脚本生成").Select
Range("C3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1X邻区").Select
Range("E3:E999").Select
Selection.Copy
Sheets("脚本生成").Select
Range("G3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1X邻区").Select
Range("J3:J999").Select
Selection.Copy
Sheets("脚本生成").Select
Range("H3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.ScreenUpdating = True
End Sub
这个宏是我选定了A1:A999后的宏,我想请教下这个宏如果想随着我鼠标选定区域的变化而变化,该怎么改,比如我选了A3:A10区域,那我希望宏运行针对的是A3:A10里面数据