Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Need help with a macro I can not for some reason get to work what I am
trying to do is copy cells "AF78:AJ78" and then do a copy, paste special to "AF81:AJ81" and then calculate "rand() " and copy "AF78:AJ78" again and then paste special to column AF82:AJ82 and then repeat the same procedure 10, 50, 200 times if wanted. I have no problem editing the macro for the number of times I want to calculate, copy and paste. Thanks in Advance Sub afpaste() Dim rng As Range, i As Long, j As Dim cell As Range, n As Long, v(1 To 5) As String Dim s As Long s = Applicaton.Calculation Application.Calculation = xlManual n = 25 Set rng = Range("AF78:AJ78") v(1) = "AF": v(2) = "AG": v(3) = "AH" v(4) = "AI": v(5) = "AJ" For i = 1 To n Application.Calculate j = 0 For Each cell In rng j = j + 1 Cells(i, v(j)).Value = cell.Value Next Next Application.Calculate = s End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
large file - copy and paste small group | Excel Discussion (Misc queries) | |||
Copy data and paste to different sheet named on Group | Excel Discussion (Misc queries) | |||
Calculate, Copy, Paste | Excel Programming | |||
vba to sort group copy paste to another sheet | Excel Programming | |||
vba to sort group copy paste to another sheet | Excel Worksheet Functions |