C
Chris T-M
I am writing a retrieval program. The first part works great (Thanks RBS),
but I need help getting back to my starting workbook and the Row I want. They
are currently entered directly in my Macro, but I want them to change each
time I run the Macro.
Sub Test ()
'////START CODE////
Dim rng As Range
Dim oHyperLink As Hyperlink
'////SELECT FILE LINK////
On Error Resume Next
Set rng = Application.InputBox(Prompt:="Select Project Link", _
Title:="picking a hyperlink", _
Type:=8)
If rng Is Nothing Then
On Error GoTo 0
Exit Sub
Else
Set oHyperLink = rng.Hyperlinks(1)
If oHyperLink Is Nothing Then
MsgBox "Need to pick a cell with a hyperlink!", , "picking a
Hyperlink "
On Error GoTo 0
Exit Sub
End If
End If
On Error GoTo 0
'////FOLLOW LINK//SELECT TAB//SELECT DATA//
oHyperLink.Follow NewWindow:=False, AddHistory:=True
Worksheets("L4_Request").Activate
Range("A10:H10").Select
'////TURN CELL VALUES INTO TEXT//COPY//
Selection.Copy
Range("A11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
'////RETURN TO LOG//SELECT CELLS//PASTE//
Windows("Test Book2.xls").Activate
Range("B10").Select
ActiveSheet.Paste
End Sub
but I need help getting back to my starting workbook and the Row I want. They
are currently entered directly in my Macro, but I want them to change each
time I run the Macro.
Sub Test ()
'////START CODE////
Dim rng As Range
Dim oHyperLink As Hyperlink
'////SELECT FILE LINK////
On Error Resume Next
Set rng = Application.InputBox(Prompt:="Select Project Link", _
Title:="picking a hyperlink", _
Type:=8)
If rng Is Nothing Then
On Error GoTo 0
Exit Sub
Else
Set oHyperLink = rng.Hyperlinks(1)
If oHyperLink Is Nothing Then
MsgBox "Need to pick a cell with a hyperlink!", , "picking a
Hyperlink "
On Error GoTo 0
Exit Sub
End If
End If
On Error GoTo 0
'////FOLLOW LINK//SELECT TAB//SELECT DATA//
oHyperLink.Follow NewWindow:=False, AddHistory:=True
Worksheets("L4_Request").Activate
Range("A10:H10").Select
'////TURN CELL VALUES INTO TEXT//COPY//
Selection.Copy
Range("A11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
'////RETURN TO LOG//SELECT CELLS//PASTE//
Windows("Test Book2.xls").Activate
Range("B10").Select
ActiveSheet.Paste
End Sub