i want to paste special for following macro on destination range.Paste special not working.
how to execute paste special in following condition.
please reply if any one have such solution.
how to execute paste special in following condition.
please reply if any one have such solution.
Code:
Private Sub CommandButton1_Click() Dim wkbCrntWorkBook As Workbook
Dim wkbSourceBook As Workbook
Dim rngSourceRange As Range
Dim rngDestination As Range
Set wkbCrntWorkBook = ActiveWorkbook
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Excel 2007-13", "*.xls; *.xlsx; *.xlsm; *.xlsa"
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
Workbooks.Open .SelectedItems(1)
Set wkbSourceBook = ActiveWorkbook
Set rngSourceRange = Application.InputBox(prompt:="Select source range", Title:="Source Range", Default:="A1", Type:=8)
wkbCrntWorkBook.Activate
Set rngDestination = Application.InputBox(prompt:="Select destination cell", Title:="Select Destination", Default:="A5", Type:=8)
rngSourceRange.Copy rngDestination
ActiveSheet.Unprotect Password:="123"
rngDestination.CurrentRegion.EntireColumn.AutoFit
wkbSourceBook.Close False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="123"
End If
End With
End Sub