I have a bit of a dilemma I've been trying to resolve since yesterday. I am needing to print some documents to PDF and store them in particular folders based on cell values. I have this code so far:
First Issue = If B8 is Null, the code is skipping to the last FP line instead of moving to the next FP line.
Second Issue = In order to reduce the time it's taking to perform this process, I'm going to move the saving to the User's desktop. The issue is that some people in my company have partially migrated to OneDrive, so there are 2 potential paths to a User's desktop.
Suggestions on how to change the code to solve these issues, with the first issue being the more significant one.
VBA Code:
If nP1.Range("B8").Value <> """" Then
fP = "Masked Path\" & nP1.Range("B8").Value & "\"
ElseIf nP1.Range("B9").Value <> """" Then
fP = "Masked Path\" & nP1.Range("B9").Value & "\"
ElseIf nP1.Range("B10").Value <> """" Then
fP = "Masked Path\" & nP1.Range("B10").Value & "\"
ElseIf nP1.Range("B11").Value <> """" Then
fP = "Masked Path\" & nP1.Range("B11").Value & "\"
ElseIf nP1.Range("B12").Value <> """" Then
fP = "Masked Path\" & nP1.Range("B12").Value & "\"
Else
fP = "Masked Path\"
End If
First Issue = If B8 is Null, the code is skipping to the last FP line instead of moving to the next FP line.
Second Issue = In order to reduce the time it's taking to perform this process, I'm going to move the saving to the User's desktop. The issue is that some people in my company have partially migrated to OneDrive, so there are 2 potential paths to a User's desktop.
Suggestions on how to change the code to solve these issues, with the first issue being the more significant one.