Sub 画面停止1() Dim i As Integer, j As Integer timck = Timer Rnd (-12345) Randomize (1) ThisWorkbook.Activate For i = 1 To 2 For j = 1 To 1000 Sheets("Sheet1").Select Cells(j, i) = Int(100 * Rnd + 1) Sheets("Sheet2").Select Cells(j, i) = Int(100 * Rnd + 1) Next j Next i Sheets("Sheet1").Select MsgBox "マクロ処理時間⇒ " & Timer - timck & "秒" End Sub |
Sub 画面停止2() Dim i As Integer, j As Integer Rnd (-12345) Randomize (1) ThisWorkbook.Activate Application.ScreenUpdating = False For i = 1 To 2 For j = 1 To 1000 Sheets("Sheet1").Select Cells(j, i) = Int(100 * Rnd + 1) Sheets("Sheet2").Select Cells(j, i) = Int(100 * Rnd + 1) Next j Next i Sheets("Sheet1").Select Application.ScreenUpdating = True End Sub |
Sub 画面停止3() Dim i As Integer, j As Integer Rnd (-12345) Randomize (1) ThisWorkbook.Activate ActiveWindow.WindowState = xlMinimized For i = 1 To 2 For j = 1 To 1000 Sheets("Sheet1").Select Cells(j, i) = Int(100 * Rnd + 1) Sheets("Sheet2").Select Cells(j, i) = Int(100 * Rnd + 1) Next j Next i Sheets("Sheet1").Select ActiveWindow.WindowState = xlMaximized End Sub |
Sub 画面停止4() Dim i As Integer, j As Integer Rnd (-12345) Randomize (1) ThisWorkbook.Activate Application.Visible = False For i = 1 To 2 For j = 1 To 1000 Sheets("Sheet1").Select Cells(j, i) = Int(100 * Rnd + 1) Sheets("Sheet2").Select Cells(j, i) = Int(100 * Rnd + 1) Next j Next i Sheets("Sheet1").Select Application.Visible = True End Sub |
Sub 無駄削除1() Dim i As Integer, j As Integer Rnd (-12345) Randomize (1) ThisWorkbook.Activate For i = 1 To 2 For j = 1 To 1000 Sheets("Sheet1").Cells(j, i) = Int(100 * Rnd + 1) Sheets("Sheet2").Cells(j, i) = Int(100 * Rnd + 1) Next j Next i Sheets("Sheet1").Select End Sub |
Sub Macro2010() Range("A1:D9").Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous ・・・・ 以下 40ステータスほどあります。 ------------------------------------------------------------ Sub Macro罫線() Range("A1:D9").Borders.LineStyle = xlContinuous End Sub ------------------------------------------------------------ Sub Macro罫線消す() Range("A1:D9").Borders.LineStyle = xlNone End Sub |
画面停止+ダイレクト記入Sub 無駄削除2() Dim i As Integer, j As Integer Rnd (-12345) Randomize (1) ThisWorkbook.Activate Application.ScreenUpdating = False For i = 1 To 2 For j = 1 To 1000 Sheets("Sheet1").Cells(j, i) = Int(100 * Rnd + 1) Sheets("Sheet2").Cells(j, i) = Int(100 * Rnd + 1) Next j Next i Sheets("Sheet1").Select Application.ScreenUpdating = True End Sub |
Sub 無駄削除3() Dim i As Integer, j As Integer Rnd (-12345) Randomize (1) bokmane = ThisWorkbook.Name ActiveWindow.Visible = False For i = 1 To 2 For j = 1 To 1000 With ThisWorkbook .Worksheets("Sheet1").Cells(j, i) = Int(100 * Rnd + 1) .Worksheets("Sheet2").Cells(j, i) = Int(100 * Rnd + 1) End With Next j Next i Windows(bokmane).Visible = True Sheets("Sheet1").Select End Sub |
Sub 無駄削除4() Dim i As Integer, j As Integer ThisWorkbook.Activate Application.ScreenUpdating = False For j = 1 To 1000 Cells(j, 1).Select With Selection.Font .Name = "MS Pゴシック" .FontStyle = "標準" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Next j Sheets("Sheet1").Select Application.ScreenUpdating = True End Sub --------------------------------------------------------- Sub 無駄削除5() Dim i As Integer, j As Integer ThisWorkbook.Activate Application.ScreenUpdating = False For j = 1 To 1000 Cells(j, 1).Select With Selection.Font .Size = 10 End With Next j Sheets("Sheet1").Select Application.ScreenUpdating = True Cells(j, 1).Font.Size = 10 サイズのみ指定はこれでよい End Sub |