countryfan_nt
Well-known Member
- Joined
- May 19, 2004
- Messages
- 748
Hello friends! Hope all is well!
The below code (first one) is giving me an error (Type Mismatch).
I am basically running a loop; where the code goes from C4:C whatever); and the code will stop when the cells in C are empty (i.e. equals “”).
Please kindly help me and thanks a lot in advance!
The below code (first one) is giving me an error (Type Mismatch).
I am basically running a loop; where the code goes from C4:C whatever); and the code will stop when the cells in C are empty (i.e. equals “”).
Please kindly help me and thanks a lot in advance!
Code:
Sub pdfit()
Do Until ActiveCell.Value = ""
Sheets("EnterID").Select
Range("C3").Select
ActiveCell.Value = ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Selection.Copy
Sheets("Results").Select
Range("D2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CalculateFull
Call Picture5_Click
Loop
End Sub
Code:
Sub Picture5_Click()
Dim LoginName As String
Dim Name As String
LoginName = UCase(GetUserID)
Name = Sheets("Results").Range("AA14")
' Assemble the filename
sFileName = "C:\Users\" & LoginName & "\Desktop\" & Name & ".pdf"
' Save the File as PDF
Sheets("Results").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
sFileName, Quality _
:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End Sub
Last edited: