I am trying to copy few columns using input box and paste it in the destination cells/range using inputbox. In the below code i am unable to paste it in the destination cell as i am getting "Run time error '438'","Object doesn't support this property or method".
my codes
Sub DFMA_MAKE()
Dim sourcefile As Workbook
Dim source_file As String
Dim myrange As Range
Dim desti_range As Range
source_file = Application.GetOpenFilename(FileFilter:="Excel files (*.xls), *.xls", Title:="Please choose a file")
Set sourcefile = Workbooks.Open(Filename:=source_file, ReadOnly:=yes)
Set myrange = Application.InputBox _
(Prompt:="Select any range", Title:="Select the range", Type:=8)
myrange.Copy
Workbooks("DFMA Template_P latest.xlsm").Activate
Worksheets("DFMA MAKE").Select
Set desti_range = Application.InputBox _
(Prompt:="Select range", Title:="Select the Destination range", Type:=8)
desti_range.Paste
Range("A2").Select
Application.CutCopyMode = False
sourcefile.Close SaveChanges = no
End Sub
Please direct me to the correct codes.
Thanks in advance,
Dee
my codes
Sub DFMA_MAKE()
Dim sourcefile As Workbook
Dim source_file As String
Dim myrange As Range
Dim desti_range As Range
source_file = Application.GetOpenFilename(FileFilter:="Excel files (*.xls), *.xls", Title:="Please choose a file")
Set sourcefile = Workbooks.Open(Filename:=source_file, ReadOnly:=yes)
Set myrange = Application.InputBox _
(Prompt:="Select any range", Title:="Select the range", Type:=8)
myrange.Copy
Workbooks("DFMA Template_P latest.xlsm").Activate
Worksheets("DFMA MAKE").Select
Set desti_range = Application.InputBox _
(Prompt:="Select range", Title:="Select the Destination range", Type:=8)
desti_range.Paste
Range("A2").Select
Application.CutCopyMode = False
sourcefile.Close SaveChanges = no
End Sub
Please direct me to the correct codes.
Thanks in advance,
Dee