LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Calculate,Copy, Paste Cell Group

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
large file - copy and paste small group CHEL294 Excel Discussion (Misc queries) 2 June 4th 09 09:08 PM
Copy data and paste to different sheet named on Group Prem Excel Discussion (Misc queries) 1 February 21st 08 02:56 PM
Calculate, Copy, Paste [email protected] Excel Programming 6 November 16th 05 01:44 PM
vba to sort group copy paste to another sheet tango Excel Programming 1 November 5th 04 08:08 AM
vba to sort group copy paste to another sheet mango Excel Worksheet Functions 0 November 5th 04 04:27 AM


All times are GMT +1. The time now is 03:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"