excel - Cycle through employee numbers and save multiple PDF files -
the spreadsheet have has 2 tabs, 1 of tabs list of employees each of has unique employee number , various other pieces of information employee.
the second tab have page put employee number in , bring through of employee's information using vlookups, there save button can save employee's information pdf file.
on save button, there macro can press button , save employees information multiple different pdf files, not saving them 1 @ time?
i'm talking cycling through employee numbers , saving each one?
the code have attached button follows:
option explicit sub savepdf() dim wsheet worksheet dim vfile variant dim sfile string set wsheet = activesheet sfile = replace(replace(range("i11"), " ", ""), ".", "_") _ & "_" _ & range("i10") _ & ".pdf" sfile = thisworkbook.path & "\" & sfile excel.application.filedialog(msofiledialogsaveas) dim integer = 1 .filters.count if instr(.filters(i).extensions, "pdf") <> 0 exit next .filterindex = .initialfilename = sfile .show if .selecteditems.count > 0 vfile = .selecteditems.item(.selecteditems.count) end if vfile <> "false" wsheet.range("a1:bf47").exportasfixedformat _ type:=xltypepdf, _ filename:=vfile, _ quality:=xlqualitystandard, _ includedocproperties:=true, _ ignoreprintareas:=false, _ openafterpublish:=false end if end sub
Comments
Post a Comment