Good day,
I am really hoping someone can advise how I can resolve a runtime error 6 "Overflow", that I'm getting at the bolded area in my code. I didn't get this error with a smaller data set, but with larger data sets I get this error and I really need to access larger data loads: Thanks in advance for any suggestions!
Sub Get_Data()
Dim LastRow As Long '<< not Integer
Dim WB As Workbook
Dim xlsPath As String
Dim xlsFilename As String
Dim SheetName As String
Dim shtSrc As Worksheet, shtDest As Worksheet, rngSrc As Range
Application.ScreenUpdating = False
If Dir$("G:\Test.*xl*") = "" Then
MsgBox "The Report was not found in the Reports folder"
Exit Sub
End If
xlsPath = "G:\Test.*xl*"
Set WB = Workbooks.Open(xlsPath)
Set shtSrc = WB.Sheets("Report 1")
Set shtDest = Workbooks("Convert Master Template.xlsb").Sheets("Data")
LastRow = shtSrc.Cells(shtSrc.Rows.Count, "A").End(xlUp).Row
Set rngSrc = shtSrc.Range(shtSrc.Range("A1"), _
shtSrc.Cells(LastRow, 46))
shtDest.Range("A1").Resize(rngSrc.Rows.Count, _
rngSrc.Columns.Count).Value = rngSrc.Value
WB.Close False
ActiveSheet.UsedRange.EntireColumn.AutoFit
Call data_formulas
End Sub]
Bookmarks