Hi All,
I have the following code that opens a csv file in background, copies everything between Cell A1 and BF from that csv file and then pastes in a a separate sheet.
I would like to modify this code so that it copes only Column A and BF from the csv file that is opened in the background , and then paste the copied contents in a separate sheet. The row count of these two columns is dynamic.
Any other columns in between A and BF can be ignored from copy paste operation
Any guidance would be apprecaied.
I have the following code that opens a csv file in background, copies everything between Cell A1 and BF from that csv file and then pastes in a a separate sheet.
I would like to modify this code so that it copes only Column A and BF from the csv file that is opened in the background , and then paste the copied contents in a separate sheet. The row count of these two columns is dynamic.
Any other columns in between A and BF can be ignored from copy paste operation
Any guidance would be apprecaied.
VBA Code:
FileToOpen = Application.GetOpenFilename(Title:="Browse for the latest TX Data", fileFilter:="CSV Files(*.csv),*csv*")
If FileToOpen <> False Then
Set Openbook = Application.Workbooks.Open(FileToOpen)
With Openbook.Sheets(1)
.Range("A1", .Range("BF" & Rows.Count).End(xlUp)).Copy
End With
ThisWorkbook.Worksheets("Vendor Swap Data").Range("A1").PasteSpecial xlPasteValues
Openbook.Close False