Is there something wrong with my formula? I'm trying to use a formula to bring me to gotoreference(I.e f5)
the cell to verify that cells are indeed right before proceeding or either msgbox prompting to proceed or that the workbook/worksheet cannot be found. Also sometimes the person leaves blank because it is quarterly data, I would like it to autoextract latest data (farthest) column.
I've two workbooks: one is my current workbook (Currentworkbook.xlsx) that I'm running the macro on. The other is Jedata.xlsx of 'Mysheettab' and few other workbooks not listed here, will be feeding information into Currentworkbook.xlsx of 'Sheet1'.
Option explicit
Sub Macro3()
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+q
'
Dim wb As Workbook
Dim ws As Worksheet
On Error Resume Next
Set wb = ActiveWorkbook("Jedata")
Set ws = ActiveWorkbook.Sheets("Mysheettab")
On Error GoTo 0
If ws Is Nothing Then
MsgBox "Data sheet not found"
Else
Activate.Windows ("wb")
Sheets("ws").Select
Application.Goto Reference:=Range("AG28:AG32").Select
Selection.Copy
Windows("Currentworkbook").Activate
Selection.Copy
Range("H10:H14").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If
End Sub