1
A
답변
2
나는 동적으로 크기를 조정하는 명명 된 범위를 VBA 메서드와 결합합니다.
먼저 명명 된 범위, MyNamedRange을 만들 : (테이블이 $ A $ 1부터 시작하여 테이블 헤더를 가지고 가정)
=OFFSET(A1,0,0,COUNTA(A:A)-1,COUNTA(1:1))
그럼 그냥 VBA의 라인을 실행합니다
ActiveSheet.PageSetup.PrintArea = "MyNamedRange"
0
하는 경우를 전체 시트를 항상 인쇄하고 싶다면 실제로 인쇄 영역을 지울 수 있으며 데이터가 채워진 시트의 양이 기본값이됩니다. 열을 숨기고 싶지 않다면 wtfsven의 대답은 완벽합니다.
1
그냥 간단한 코드를 사용 :이 꽤 늦게 응답 추측
Private Sub prnt()
On Error Resume Next
Cells(1, 1).Select
With ActiveSheet.PageSetup
.PrintArea = Range(ActiveCell, ActiveCell.SpecialCells(xlCellTypeLastCell)).Select.Address
.Orientation = xlLandscape
.LeftHeader = "&p/&N"
.LeftFooter = ActiveWorkbook.FullName 'to show address
.PrintTitleRows = "$1:$5" 'repeat at top
.Zoom = False
.Orientation = xlLandscape
.FitToPagesWide = 1 'to print in 01 page
.FitToPagesTall = False 'to print in 01 page
End With
End Sub
0
을 ... 이 솔루션은 위의 Excel 2007에서 나를 위해 작동하지 않았다 그래서 나는
begin_column = 1
end_column = 5
begin_row = 1
end_row = 30
'converting the numbers to uppercase letters
temp_begin_column = Chr(first_column + 64)
temp_end_column = Chr(second_column + 64)
ActiveSheet.PageSetup.PrintArea = "$" & temp_begin_column & "$" & begin_row & ":$" & temp_end_column & "$" & end_row
을 사용
이것은 복잡한 해결책처럼 보일지 모르지만 안정적으로 나를 위해 일한 유일한 것 같습니다.
0
나는 이것을 시도했습니다. 그것은 나를 위해 일했습니다.
StartColumn="A"
StartRow=1
EndColumn="B"
EndRow=10
ActiveSheet.PageSetup.PrintArea = StartColumn & StartRow & ":" & EndColumn & EndRow
ActiveSheet.PageSetup.PrintArea = "A1:B10"
Or
ActiveSheet.PageSetup.PrintArea = "$" & StartColumn & "$" & StartRow & ":" & "$" & EndColumn & "$" & EndRow
ActiveSheet.PageSetup.PrintArea = "$A$1:$B$10"
관련 문제
- 1. Excel - 인쇄 매크로 만들기
- 2. Excel 매크로 도움말 - 스태킹 매크로
- 3. EXcel VBA : Excel 매크로 Excel에서 매크로 테이블을 만들려면
- 4. Excel VBA 매크로
- 5. Excel 매크로 기록
- 6. Excel VBA 매크로 문서
- 7. Excel 매크로 연결
- 8. Mac Excel 2008 : 매크로?
- 9. Excel 매크로 - 값 비교
- 10. Excel 매크로, 병합 시트
- 11. Excel 매크로 필터
- 12. Excel 매크로 자동 실행
- 13. Excel 매크로 - 매크로 실행 중 화면
- 14. Excel Visual Basic 매크로 - 차트에 대해 데이터를 동적으로 선택합니까?
- 15. 피벗 차트 용 매크로 설정
- 16. 동적으로 텍스트 영역 스크롤하기
- 17. Excel 매크로 - 배열의 데이터 읽기
- 18. Excel 매크로 - 원본 서식 유지
- 19. Excel 매크로로 OOo 매크로 변환
- 20. Coldfusion에서 Excel Solver 매크로 실행
- 21. 암호로 Interop Excel 매크로 - 가능합니까?
- 22. Excel VBA/매크로 코드 분석
- 23. 빌드 스크립트에서 Excel 매크로 호출
- 24. Excel VBA로 Outlook 매크로 열기?
- 25. COM 자동화/Excel 매크로 실행
- 26. Excel 2007 xml에 매크로 포함
- 27. Excel 매크로 - for 루프 증가
- 28. Interop을 사용하여 Excel 인쇄
- 29. Excel sparklines 인쇄 문제
- 30. MKMapView 설정 영역