Created
April 10, 2018 15:54
Revisions
-
fuchao2012 created this gist
Apr 10, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ Sub getCurrentSheetData() Application.EnableEvents = False Application.ScreenUpdating = False Dim dataCount As Integer, currentSheetName As String If ActiveSheet.Name <> "result" Then currentSheetName = ActiveSheet.Name Application.StatusBar = "处理工作表" & currentSheetName & "中, 老婆大人请稍后..." If ActiveSheet.Range("K1").Value <> "加险" Then ' 正常数据 ActiveSheet.Range("A3").Select If Range("A4").Value <> "" Then dataCount = ActiveSheet.Range(Selection, Selection.End(xlDown)).Count + 2 Else dataCount = 3 End If ActiveSheet.Range(Selection, Range("J" & dataCount)).Select ActiveSheet.Range(Selection, Selection).Copy Worksheets("result").Range("A65535").End(xlUp).Offset(1, 0).AddComment Worksheets("result").Range("A65535").End(xlUp).Offset(1, 0).Comment.Text Text:=currentSheetName Worksheets("result").Range("A65535").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues End If End If End Sub