SHARE
TWEET

przesuwanie komórek

maciejms Apr 18th, 2019 (edited) 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub zamień()
  2. Dim x As Range, z As Variant, k As Integer
  3.     Set x = [a1:a20]
  4.     z = x(1)
  5.         For k = 1 To 20
  6.         x(k) = x(k + 1)
  7.         Next k
  8.     x(20) = z
  9. End Sub
  10.  
  11. Sub zamień2()
  12. Dim x As Range, z As Variant, k As Integer
  13.     Set x = [a1:a20]
  14.     z = x(20)
  15.         For k = 20 To 2 Step -1
  16.         x(k) = x(k - 1)
  17.         Next k
  18.     x(1) = z
  19. End Sub
  20. Sub zamień3()
  21. Dim x As Range, z As Variant, k As Integer
  22.     Set x = Selection
  23.     For k = 1 To x.Count / 2
  24.         z = x(k)
  25.         x(k) = x(x.Count + 1 - k)
  26.         x(x.Count + 1 - k) = z
  27.     Next k
  28. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top