Hi everyone.
I have a code here that I've been working on. The problem here is that it always end up in ERROR.
Here's the code:
Sub GREEN()
'
' GREEN Macro
'
' Keyboard Shortcut: Ctrl+Shift+G
Sheets("LIST").Activate
Range("A1").Select
Do While True
If Selection.Value = "" Then
Exit Do
Else
Selection.Copy
Sheets("2307").Activate
Range("A1").Activate
ActiveSheet.Paste
Dim SaveTo As String
Dim SaveAs As String
SaveTo = "H:\TEST\" & ActiveSheet.Range("B20").Value & "\"
SaveAs = ActiveSheet.Range("B20").Value & "-" & Format([B1], "mm.dd.yyyy")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=SaveTo & SaveAs & ".pdf", _
OpenAfterPublish:=False
Sheets("LIST").Activate
Selection.Offset(1, 0).Select
End If
Loop
End Sub
Hope you can help me.
Bookmarks