Guest User

Untitled

a guest
Jan 12th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. Sub CommandButton1_Click()
  2.  
  3. Dim CopyRng As Range, PasteRng As Range
  4.  
  5. Title = "Copy & Paste"
  6.  
  7. Set CopyRng = Application.Selection
  8.  
  9. Set CopyRng = Application.InputBox("Ranges to Copy :", Title, CopyRng.Address, Type:=8)
  10. Set PasteRng = Application.InputBox("Range to Paste, select Single cell):", Title, Type:=8)
  11.  
  12. CopyRng.Copy
  13.  
  14. PasteRng.Parent.Activate
  15.  
  16. PasteRng.PasteSpecial xlPasteValuesAndNumberFormats
  17.  
  18. PasteRng.PasteSpecial xlPasteFormats
  19.  
  20. Application.CutCopyMode = False
  21.  
  22. End Sub
Add Comment
Please, Sign In to add comment