OilEconomist
Active Member
- Joined
- Dec 26, 2016
- Messages
- 439
- Office Version
- 2019
- Platform
- Windows
How can I get data from a closed MS Excel 2019 Workbook into an open MS Excel 2010 Workbook? Had they both been the same version I could just import the sheet.
Thanks in advance for any suggestions as I will provide feedback. There are many posts with the same solution I'm using, but I need to have it adjusted as I never know how many rows will be in the closed workbook with the data.
For now I am using the following, but the issue becomes the number of rows as it might not always be 1000. I could make it bigger, but it's already slowing down my code as I'm running this as a loop. I'm doing this for many worksheets.
I was trying to find the last row in the sheet of the closed workbook so the following in the aforementioned code:
is as follows:
Also, the following brings in 0s for blanks and I would like the cell to be blank if that's what it has in it. Any other suggestions?
Thanks in advance for any suggestions as I will provide feedback. There are many posts with the same solution I'm using, but I need to have it adjusted as I never know how many rows will be in the closed workbook with the data.
For now I am using the following, but the issue becomes the number of rows as it might not always be 1000. I could make it bigger, but it's already slowing down my code as I'm running this as a loop. I'm doing this for many worksheets.
Code:
'Obtains the JIB Data from a closed workbook
With Sheets(Tab_Name)
With .Range(.Cells(3, 1), .Cells(1000, 45))
.Formula = "='" & DirFolder & "[" & File_Name & "]Sheet1'!A3"
.Value = .Value
Sheets(Tab_Name).Cells(3, 1).Select
End With
End With
I was trying to find the last row in the sheet of the closed workbook so the following in the aforementioned code:
Code:
With .Range(.Cells(3, 1), .Cells(1000, 45))
is as follows:
Code:
With .Range(.Cells(3, 1), .Cells(LastRow, 45))
Also, the following brings in 0s for blanks and I would like the cell to be blank if that's what it has in it. Any other suggestions?
Code:
.Value = .Value