Thread: Copy and Paste
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Bundy John Bundy is offline
external usenet poster
 
Posts: 772
Default Copy and Paste

Sometimes its hard to understand what folks want, i didn't see your other
posts so i don't know where test is stored or the 3 numbers but here is the
code. If you tell me the location of test# and where the info to be pasted
comes from i will modify it for you.

Sub main()
Dim numOne As Long
Dim numTwo As Long
Dim numThree As Long
Dim test As Long

test = "set value of test here or the location it is found"
numOne = "set value of numOne here or the location it is found"
numTwo = "set value of numTwo here or the location it is found"
numThree = "set value of numThree here or the location it is found"
For i = test To 400
Sheets("sheetname").Cells(i, 1) = numOne
Sheets("sheetname").Cells(i, 2) = numTwo
Sheets("sheetname").Cells(i, 3) = numThree
Next
End Sub
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Eric" wrote:

Hello all,

If I want to copy values from row 1 and paste it into any row (this number
depends on a variable called tests. However many tests I have run I need it
to count down to that row and paste the information from row 1 without
deleting anything above it.
ie:
Info to be pasted 4 5 6 Test=5

Row 1 1 2 3
row 2 1 2 3
Row3 1 2 3
Row4 1 2 3
Row5 4 5 6 this is row one information
Row6 4 5 6

The row numbers correspondes to the test number. Every row after row 5 will
be the same as row 5. This would go on until row 400.

So far no one has been able to help me and I have asked this questions 3
different ways. Does this make any sense? Please anyone help me.......