GormanRupp
New Member
- Joined
- Nov 6, 2012
- Messages
- 14
I currently have code that allows me to create hyperlinked formulas and open the pdf's based on part numbers, but some of the part numbers links do not exist. I was wondering if instead of on error resume next, is there a way to color in the cell that Errors and resume at the same time? It can be any color.
Sub hyperlinkprint()
'
' hyperlinkprint Macro
'
'
'
Dim Lastrow As Long
Lastrow = Range("A" & Rows.Count).End(xlUp).Row
Range("D2:D" & Lastrow).FormulaR1C1 = _
"=HYPERLINK(""C:\Cut Sheets NEW\""&RC[-3]&"".pdf"",RC[-3])"
Dim Cell As Range
If (MsgBox("POpen All pdf Links Available?", vbYesNo) = vbYes) Then
Lastrow = Range("D" & Rows.Count).End(xlUp).Row
For Each Cell In Range("D2:D" & Lastrow)
On Error Resume Next
ThisWorkbook.FollowHyperlink "C:\Cut Sheets NEW\" & Cell.Value & ".pdf"
On Error GoTo 0
Next Cell
End If
End Sub
Sub hyperlinkprint()
'
' hyperlinkprint Macro
'
'
'
Dim Lastrow As Long
Lastrow = Range("A" & Rows.Count).End(xlUp).Row
Range("D2:D" & Lastrow).FormulaR1C1 = _
"=HYPERLINK(""C:\Cut Sheets NEW\""&RC[-3]&"".pdf"",RC[-3])"
Dim Cell As Range
If (MsgBox("POpen All pdf Links Available?", vbYesNo) = vbYes) Then
Lastrow = Range("D" & Rows.Count).End(xlUp).Row
For Each Cell In Range("D2:D" & Lastrow)
On Error Resume Next
ThisWorkbook.FollowHyperlink "C:\Cut Sheets NEW\" & Cell.Value & ".pdf"
On Error GoTo 0
Next Cell
End If
End Sub