>>948 できました。感謝です。 Private Sub Worksheet_Change(ByVal Target As Range) Application.ScreenUpdating = False Application.EnableEvents = False Dim syou1, syou2 String Dim ten1, ten2, kazu As Integer syou1 = Range("W2") syou2 = Range("X2") ten1 = Range("W1") ten2 = Range("X1") Range("T1:T100") = ClearContents For kazu = 1 To 100 Cells(kazu, 1) = "処理中" Next For kazu = 1 To 100 Cells(kazu, 1) = ClearContents If Cells(kazu, 1) <> "処理中" Then If Cells(kazu, 19).Value >= ten2 Then Cells(kazu, 20).Value = syou2 End If If Cells(kazu, 19).Value >= ten1 Then Cells(kazu, 20).Value = syou1 End If Cells(kazu, 1) = "" End If Next Application.ScreenUpdating = True Application.EnableEvents = True End Sub
With ActiveSheet.UsedRange r = .Row + .Rows.Count - 1 With ActiveSheet.PageSetup Select Case r Case Is < 43 .Zoom = 100 .CenterFooter = "" Case Is < 47 .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .CenterFooter = "" Case Is >= 48 .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 2 .CenterFooter = "&P/&N" End Select End With End With
With ActiveSheet.UsedRange r = .Row + .Rows.Count - 1 End With With ActiveSheet.PageSetup Select Case r Case Is < 43 .Zoom = 100 .CenterFooter = "" Case Is < 47 .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .CenterFooter = "" Case Is >= 48 .Zoom = 100 .CenterFooter = "&P/&N" End Select End With
Sub a() Dim x As Long For col = 1 To Columns.Count xnew = Cells(Rows.Count, col).End(xlUp).Row x = Application.WorksheetFunction.Max(x, xnew) Next MsgBox (x) End Sub オワテタ