|
本帖最后由 OKJSJSF 于 2024-5-2 12:33 编辑
/**
* 全行数据一览无余 Macro
* 宏由 OKJSJSF 录制,时间: 2024/05/01
*/
function 全行数据一览无余()
{
Range("A1:AA1").Select();
ActiveWindow.ScrollColumn = 4;
Selection.Copy(undefined);
Sheets.Add(undefined, "Sheet1", 1, undefined);
Range("B1").Select();
Selection.PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone, false, true);
Range("A1").Select();
Application.CutCopyMode = false;
Application.DisplayAlerts = false;
ActiveWorkbook.CustomDocumentProperties.Add("KSOProductBuildVer", false, 4, "2052-12.1.0.16388", undefined);
Application.DisplayAlerts = true;
Selection.Formula = "1";
Selection.AutoFill(Range("A1:A27"), xlFillDefault);
Range("A1:A27").Select();
Range("C1").Select();
Sheets.Item("Sheet1").Activate();
Range("D3:AA3").Select();
Selection.Copy(undefined);
Sheets.Item("Sheet3").Activate();
Selection.PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone, false, true);
Application.CutCopyMode = false;
Sheets.Item("Sheet1").Activate();
ActiveWindow.ScrollColumn = 1;
Range("A3:Z3").Select();
ActiveWindow.ScrollColumn = 2;
Range("A3:AA3").Select();
ActiveWindow.ScrollColumn = 3;
Range("A3:AB3").Select();
ActiveWindow.ScrollColumn = 4;
Range("A3:AA3").Select();
Selection.Copy(undefined);
Sheets.Item("Sheet3").Activate();
Range("C1").Select();
Selection.PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone, false, true);
Range("A15:C27").Select();
Selection.Cut(undefined);
Range("D1").Select();
ActiveSheet.Paste(undefined, undefined);
Range("A1:F14").Select();
Range("D1").Activate();
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlEdgeLeft));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlEdgeTop));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlEdgeBottom));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlEdgeRight));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlInsideVertical));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlInsideHorizontal));
Selection.Borders.Item(xlEdgeLeft).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlEdgeTop).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlEdgeBottom).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlEdgeRight).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlInsideVertical).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlInsideHorizontal).ColorIndex = xlColorIndexAutomatic;
Range("A1:C14").Select();
(obj=>{
obj.Weight = xlThick;
obj.LineStyle = xlDouble;
obj.ColorIndex = xlColorIndexAutomatic;
obj.TintAndShade = 0;
})(Selection.Borders.Item(xlEdgeRight));
Columns.Item("A:F").Select();
Selection.AutoFit();
Selection.Font.Bold = true;
Selection.Font.Bold = false;
Selection.Interior.Pattern = xlPatternNone;
(obj=>{
obj.ColorIndex = xlColorIndexAutomatic;
obj.TintAndShade = 0;
})(Selection.Font);
Range("G1").Select();
}/**
* 全行数据一览无余 Macro
* 宏由 OKJSJSF 录制,时间: 2024/05/01
*/
function 全行数据一览无余()
{
Range("A1:AA1").Select();
ActiveWindow.ScrollColumn = 4;
Selection.Copy(undefined);
Sheets.Add(undefined, "Sheet1", 1, undefined);
Range("B1").Select();
Selection.PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone, false, true);
Range("A1").Select();
Application.CutCopyMode = false;
Application.DisplayAlerts = false;
ActiveWorkbook.CustomDocumentProperties.Add("KSOProductBuildVer", false, 4, "2052-12.1.0.16388", undefined);
Application.DisplayAlerts = true;
Selection.Formula = "1";
Selection.AutoFill(Range("A1:A27"), xlFillDefault);
Range("A1:A27").Select();
Range("C1").Select();
Sheets.Item("Sheet1").Activate();
Range("D3:AA3").Select();
Selection.Copy(undefined);
Sheets.Item("Sheet3").Activate();
Selection.PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone, false, true);
Application.CutCopyMode = false;
Sheets.Item("Sheet1").Activate();
ActiveWindow.ScrollColumn = 1;
Range("A3:Z3").Select();
ActiveWindow.ScrollColumn = 2;
Range("A3:AA3").Select();
ActiveWindow.ScrollColumn = 3;
Range("A3:AB3").Select();
ActiveWindow.ScrollColumn = 4;
Range("A3:AA3").Select();
Selection.Copy(undefined);
Sheets.Item("Sheet3").Activate();
Range("C1").Select();
Selection.PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone, false, true);
Range("A15:C27").Select();
Selection.Cut(undefined);
Range("D1").Select();
ActiveSheet.Paste(undefined, undefined);
Range("A1:F14").Select();
Range("D1").Activate();
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlEdgeLeft));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlEdgeTop));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlEdgeBottom));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlEdgeRight));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlInsideVertical));
(obj=>{
obj.Weight = xlThin;
obj.LineStyle = xlContinuous;
})(Selection.Borders.Item(xlInsideHorizontal));
Selection.Borders.Item(xlEdgeLeft).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlEdgeTop).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlEdgeBottom).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlEdgeRight).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlInsideVertical).ColorIndex = xlColorIndexAutomatic;
Selection.Borders.Item(xlInsideHorizontal).ColorIndex = xlColorIndexAutomatic;
Range("A1:C14").Select();
(obj=>{
obj.Weight = xlThick;
obj.LineStyle = xlDouble;
obj.ColorIndex = xlColorIndexAutomatic;
obj.TintAndShade = 0;
})(Selection.Borders.Item(xlEdgeRight));
Columns.Item("A:F").Select();
Selection.AutoFit();
Selection.Font.Bold = true;
Selection.Font.Bold = false;
Selection.Interior.Pattern = xlPatternNone;
(obj=>{
obj.ColorIndex = xlColorIndexAutomatic;
obj.TintAndShade = 0;
})(Selection.Font);
Range("G1").Select();
} |
|