Добрый день. Выскакивает ошибка при выполнении такого макроса, подскажите, в чем может быть проблема? [vba]
Код
Sub Печать() Sheets("1").PrintOut Copies:=CInt(Sheets("Описи").Range("AF3")), Collate:=True, IgnorePrintAreas:=False On Error Resume Next Sheets("2").PrintOut Copies:=CInt(Sheets("Описи").Range("AF4")), Collate:=True, IgnorePrintAreas:=False On Error Resume Next Sheets("3").PrintOut Copies:=CInt(Sheets("Описи").Range("AF5")), Collate:=True, IgnorePrintAreas:=False On Error Resume Next
[/vba]
Добрый день. Выскакивает ошибка при выполнении такого макроса, подскажите, в чем может быть проблема? [vba]
Код
Sub Печать() Sheets("1").PrintOut Copies:=CInt(Sheets("Описи").Range("AF3")), Collate:=True, IgnorePrintAreas:=False On Error Resume Next Sheets("2").PrintOut Copies:=CInt(Sheets("Описи").Range("AF4")), Collate:=True, IgnorePrintAreas:=False On Error Resume Next Sheets("3").PrintOut Copies:=CInt(Sheets("Описи").Range("AF5")), Collate:=True, IgnorePrintAreas:=False On Error Resume Next
либо в именах листов (существуют такие имена в той книге, где пытаетесь выполнить макрос?) либо в значениях ячеек "AF3" "AF4" "AF5" (может они не содержат числовых значений)
либо в именах листов (существуют такие имена в той книге, где пытаетесь выполнить макрос?) либо в значениях ячеек "AF3" "AF4" "AF5" (может они не содержат числовых значений)
Добрый день. Прописала маленький макрос. Сохранила в этой книге. Книга остается открытой, но при выполнение в другой книге маркос дает ошибку run-time error 1004 - компонент с указанным именем не найден. Что я сделала не так? [vba]
Код
Sub Макрос3() ' ' Макрос3 Макрос '
' ActiveSheet.Shapes.Range(Array("Picture 6")).Select ActiveSheet.Shapes.SelectAll Selection.ShapeRange.Height = 70.8661417323 Selection.Placement = xlMoveAndSize Cells.Select Selection.ColumnWidth = 12.86 Selection.RowHeight = 75 Columns("A:A").Select Selection.ColumnWidth = 6.57 Columns("B:B").ColumnWidth = 11 Rows("1:1").RowHeight = 48 Rows("1:1").Select Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Selection.RowHeight = 20.25 Columns("D:H").Select Selection.Delete Shift:=xlToLeft Range("E:E,G:G").Select Range("G1").Activate Selection.Delete Shift:=xlToLeft Columns("E:E").Select Selection.ColumnWidth = 10.43 Columns("D:D").Select Selection.ColumnWidth = 7.29 Selection.ColumnWidth = 6.43 Columns("J:M").Select Selection.Delete Shift:=xlToLeft Range("K:K,N:N").Select Range("N1").Activate Selection.Delete Shift:=xlToLeft Columns("F:L").Select Selection.ColumnWidth = 6.71 With Selection .HorizontalAlignment = xlCenter .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Rows("2:2").Select With Selection.Font .ColorIndex = xlAutomatic .TintAndShade = 0 End With Selection.Font.Bold = True Selection.Font.Italic = True Selection.Font.Italic = False Selection.Font.Bold = False With Selection .VerticalAlignment = xlCenter .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Range("A2").Select Range(Selection, Selection.End(xlToRight)).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 .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With Range("N3").Select End Sub
[/vba]
Добрый день. Прописала маленький макрос. Сохранила в этой книге. Книга остается открытой, но при выполнение в другой книге маркос дает ошибку run-time error 1004 - компонент с указанным именем не найден. Что я сделала не так? [vba]
Код
Sub Макрос3() ' ' Макрос3 Макрос '
' ActiveSheet.Shapes.Range(Array("Picture 6")).Select ActiveSheet.Shapes.SelectAll Selection.ShapeRange.Height = 70.8661417323 Selection.Placement = xlMoveAndSize Cells.Select Selection.ColumnWidth = 12.86 Selection.RowHeight = 75 Columns("A:A").Select Selection.ColumnWidth = 6.57 Columns("B:B").ColumnWidth = 11 Rows("1:1").RowHeight = 48 Rows("1:1").Select Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Selection.RowHeight = 20.25 Columns("D:H").Select Selection.Delete Shift:=xlToLeft Range("E:E,G:G").Select Range("G1").Activate Selection.Delete Shift:=xlToLeft Columns("E:E").Select Selection.ColumnWidth = 10.43 Columns("D:D").Select Selection.ColumnWidth = 7.29 Selection.ColumnWidth = 6.43 Columns("J:M").Select Selection.Delete Shift:=xlToLeft Range("K:K,N:N").Select Range("N1").Activate Selection.Delete Shift:=xlToLeft Columns("F:L").Select Selection.ColumnWidth = 6.71 With Selection .HorizontalAlignment = xlCenter .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Rows("2:2").Select With Selection.Font .ColorIndex = xlAutomatic .TintAndShade = 0 End With Selection.Font.Bold = True Selection.Font.Italic = True Selection.Font.Italic = False Selection.Font.Bold = False With Selection .VerticalAlignment = xlCenter .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Range("A2").Select Range(Selection, Selection.End(xlToRight)).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 .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With Range("N3").Select End Sub