Declanscully
New Member
- Joined
- Mar 5, 2013
- Messages
- 12
This might be too much of an ask, or it might be much simpler than I think.
I am looking for some VBA code to open a workbook, and copy certain cells from each worksheet into the new workbook.
The open workbook part this works perfectly:
The trick then is I want to copy specific cells from multiple worksheets in the opened workbook to cells in the new work book (J3 to A1), I don't mind brute forcing the copy portion, it will be easier for me to follow.
But I am not sure how to cycle through the worksheets so that I can get all the required data.
I am looking for some VBA code to open a workbook, and copy certain cells from each worksheet into the new workbook.
The open workbook part this works perfectly:
VBA Code:
Sub GetFile()
Dim fileNameAndPath As Variant
fileNameAndPath = Application.GetOpenFilename(FileFilter:="Excel Files (*.XLS), *.XLS", Title:="Select File To Be Opened")
If fileNameAndPath = False Then Exit Sub
Workbooks.Open Filename:=fileNameAndPath
End Sub
The trick then is I want to copy specific cells from multiple worksheets in the opened workbook to cells in the new work book (J3 to A1), I don't mind brute forcing the copy portion, it will be easier for me to follow.
But I am not sure how to cycle through the worksheets so that I can get all the required data.