LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Store cell & workbook references, to retrieve later in Macro

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying Spreadsheet with Cell References Into A Different Workbook MonkeyHanger Excel Discussion (Misc queries) 1 March 28th 07 03:09 PM
Macro without cell references...... Winnie_Shrub Excel Discussion (Misc queries) 1 June 28th 06 09:09 AM
how to get a macro to store address of a cell SMH Excel Programming 1 May 18th 05 02:40 PM
How do I retrieve my personal macro workbook? GJP99 Excel Programming 2 April 28th 05 01:12 AM
Store Information but not in a Workbook Andibevan[_2_] Excel Programming 2 March 30th 05 02:11 PM


All times are GMT +1. The time now is 10:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"