A tool has been built to make a process essentially more efficient and with less chance at human error. A lot of it is copy columns/rows and pasting it elsewhere as well as filtering pivot tabs and rows/columns then refreshing. I have some vlookup
formulas as well referencing the tables and other worksheets.
This is an example of one of the formulas I use to compare previous data with the data that is produced using the tool.
=IFERROR((VLOOKUP(A5,$A5:$AH170,34,FALSE)-(VLOOKUP(A5,$AN5:$AR485,5,FALSE)))/(VLOOKUP(A5,$A5:$AH170,34,FALSE))," ")
below is a macro built to open the computer library and allow the user to choose a file and then the macro will copy certain columns and paste it in the workbook.
The problem I am having is the worksheet that has the formula I placed above as well as references to other pages hides over 1000 rows and even though the option to unhide is available it will not unhide them. Something within the macro below is causing the issue. Since no errors are popping up I'm finding it very hard to pinpoint the reason.
Sub GetData_Example4()
Dim SaveDriveDir As String, MyPath As String
Dim FName As Variant, wb As Workbook, shtDest As Worksheet
SaveDriveDir = CurDir
MyPath = Application.DefaultFilePath 'or use "C:\Data"
ChDrive MyPath
ChDir MyPath
FName = Application.GetOpenFilename(filefilter:="Excel Files, *.xl*")
If FName = False Then
'do nothing
Else
Application.ScreenUpdating = False
Set shtDest = ThisWorkbook.Sheets("Data")
With Workbooks.Open(FName, ReadOnly:=True)
.Sheets("Sheet1").ShowAllData
ActiveSheet.Range("$A$1:$AF$7935").AutoFilter Field:=8, Criteria1:=Array( _
"CAD", "GBP", "USD"), Operator:=xlFilterValues
On Error Resume Next
.Sheets("Sheet1").Range("D1:D10000").Copy shtDest.Range("A2")
On Error Resume Next
.Sheets("Sheet1").Range("H1:H10000").Copy shtDest.Range("B2")
On Error Resume Next
.Sheets("Sheet1").Range("Q1:Q10000").Copy shtDest.Range("C2")
On Error Resume Next
.Sheets("Sheet1").Range("R1:R10000").Copy shtDest.Range("D2")
On Error Resume Next
.Sheets("Sheet1").Range("AB1:AB10000").Copy shtDest.Range("E2")
On Error Resume Next
.Sheets("Sheet1").Range("AA1:AA10000").Copy shtDest.Range("F2")
On Error Resume Next
.Close False
End With
ActiveSheet.Range("F:F").Select
Range("F2").Activate
Selection.NumberFormat = "[$-F800]dddd, mmmm dd, yyyy"
ActiveSheet.Range("$A$2:$F$7936").AutoFilter Field:=5, Criteria1:=Array( _
"12", "3", "4"), Operator:=xlFilterValues
Sheets("Data").Visible = False
End If
ChDrive SaveDriveDir
ChDir SaveDriveDir
ActiveWorkbook.RefreshAll
End Sub