|
* 답변하시는 분들께 도움이 되도록 자신의 환경을 아래 항목 옆에 기재해 주세요.
- 엑셀 버전(95,97,2000,xp,2003,2007): 2013
* 아래줄에 질문을 작성하세요 >>
아 해외출장에서 복귀하는 바람에 감사인사가 늦었습니다.
정말 감사드리구요,
더불어서 한가지만 부탁 드릴께요.
output에서 "pdf로 저장하기" 버튼을 눌렀을 때 현재파일명+B1(할인코드).PDF의 형태로 B1(할인코드)의 값에 따라서 반복 저장하고 싶습니다.
부탁드립니다.
==============[젖은빵님 글에 대한 답변입니다]==============
할인코드유형에 따라 모두 저장하고 싶은 거죠???
첨부화일 참조하세요..
Private Sub CommandButton1_Click()
Dim rDC As Range, rValid As Range, rX As Range
Dim sValid As String
Dim sPath As String, sFile As String
sPath = ThisWorkbook.Path & Application.PathSeparator
Set rDC = Me.[B1]
sValid = Split(rDC.Validation.Formula1, "=")(1)
Set rValid = Worksheets(Split(sValid, "!")(0)).Range(Split(sValid, "!")(1)).SpecialCells(xlCellTypeConstants, 23)
For Each rX In rValid
rDC.Value = rX
UserPrintArea.ExportAsFixedFormat xlTypePDF, sPath & "_" & rX.Value
Application.Wait Now() + TimeValue("00:00:01")
Next
MsgBox "PDF 파일 생성이 완료되었습니다.", vbInformation
End Sub
|
|