Hi, new to this sort of programming.
What i am after is to have my excel sheet open, hit an import button to bring in either an .xml, or .csv file which user can select using GetOpenFilename.
I have written the following, my issue is that when it pastes the data into my workbook , it always goes into sheet #1, which contains the button.
[I]Sub GetCSV()
Dim strFile As String
Dim wkb1 As Workbook
Dim wkb2 As Workbook
Set wkb1 = ActiveWorkbook
strFile = Application.GetOpenFilename
If strFile = "False" Then Exit Sub
' false means no file selected
Workbooks.Open strFile
' set active workbook
Set wkb2 = ActiveWorkbook
wkb2.ActiveSheet.Range("A1:GP350").Copy Destination:=wkb1.ActiveSheet _
.Range("A5:GP350")
'wkb2.Range("A1:GP350").Copy Destination:=wkb1.Range("A5:GP350")
wkb2.Close SaveChanges:=False
End Sub
How can i alter this to allow me to select sheet4 or in my case ConfigData Sheet as I have renamed sheet #4 to this name?
Have tried heaps of stuff with no joy...
Any help greatly appreciated.
Thanks,
Vossy51
Bookmarks