vba - After Loop ends How do I make it go no next? -
i got loop going , next part going recorded macro. want put them same macro , here stucked. thought?
sub skapapdf() ' ' skapapdf macro ' dim ws, ws1 worksheet dim lastrow long set ws = sheets("uträkning") set ws1 = sheets("tillpdf") 'application.screenupdating = false sheets("tillpdf").select ws1.rows("2:2").select until isempty(activecell.value) sheets("tillpdf").select ws1.rows("2:2").select selection.copy range("a" & rows.count).end(xlup).offset(1).select selection.pastespecial paste:=xlpasteformulas, operation:=xlnone, skipblanks _ :=false, transpose:=false rows(activecell.row).select selection.copy selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false ws1.rows("2:2").select selection.copy lastrow = cells(rows.count, 1).end(xlup).row activecell.end(xldown).offset(1, 0).select selection.pastespecial paste:=xlpasteformulas, operation:=xlnone, skipblanks _ :=false, transpose:=false rows(activecell.row).select selection.copy selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false range("a" & rows.count).end(xlup).select if activecell.value = "0" exit sub loop application.screenupdating = true range("a2").select range(selection, selection.end(xltoright)).select range(selection, selection.end(xldown)).select selection.copy sheets("pdf").select range("a3").select selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false rows("3:3").select application.cutcopymode = false selection.copy selection.pastespecial paste:=xlpasteformats, operation:=xlnone, _ skipblanks:=false, transpose:=false application.cutcopymode = false range(selection, selection.end(xldown)).select sheets("pdf").select activesheet.exportasfixedformat type:=xltypepdf, _ filename:="\\naspri01tsivz2.tcad.telia.se\ts-home136$\lrc691\documents\kemikalieskatt\kemikalieskatt &activecell(q1).pdf", _ openafterpublish:=true end sub
Comments
Post a Comment