Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to refer back to any row that was selected prior to starting my
macro. Specifically I am trying to move to A_ of the pre-selected Row, and follow a hyperlink, gather data from another workbook, and then return to the original Row in the original workbook so I can paste the new data. I have been successful in writing code that works from a preselected Row, but can't seem to figure how to allow any starting point. (Simplified current code follows) (New to VBA. Please include the basics. Thanks in advance.) '// 1) Save Variables Dim LogBk As String LogBk = ActiveWorkbook.Name '// 2) Follow Hyperlink Range("A33").Select Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True ActiveWindow.ScrollWorkbookTabs Position:=xlLast Sheets("REPORTING").Select '// 3) Copy Data Range("12B:12AA").Select Selection.Copy Windows(LogBk).Activate Range("33B:33AA").Select ActiveSheet.Paste End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum cells based on a row variable and seperate column variable | Excel Worksheet Functions | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming | |||
Pivot Table - Object variable or with block variable not set? | Excel Programming |