Copy and Paste

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.......
 
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
 
I am not at all sure I understand the question, but:

1. Information is in row #1
2. Assume test is 7

Sub c_and_p()
Set r1 = Range("1:1")
test = 7
Set r2 = Cells(test + 1, 1)
r1.Copy r2
End Sub

The routine takes the contents of row#1 and moves down 7 rows to row #8 and
then pastes the data there.
 
John,
I really appreciate this....The information is stored on "Main Menu" sheet
and in the range called tests. The information is also on the "Main Menu"
sheet but is transphered to the "JMF Change" sheet. Again Thank you Thank
you Thank you

Eric
 
Ok, I have the test piece down, where is the data to be copied stored at on
"Main Menu"? Is it in a particular cell, or row, or named range?
 
Hey John,

I was able to figure it out with one exception and that is that the numbers
are round up or down. I don't want them to round at all I want them to stay
exactly the same.
IE:
4.1 on "Main menu" is post on "JMF changes" as 4.0
0.4 is posted as 0.0
2.756 is posted as 3.00

Any solutions
 
Gotcha, in your examples they were whole numbers so i dimensioned them as
Longs, change them to doubles. (except test)

Dim numOne As Double
Dim numTwo As Double
Dim numThree As Double
Dim test As Long
 
John,
Your the best. Thank you. Can I ask you about another issue I have.
I will have a review sheet of the last four tests. I want the first test to
drop off everytime a new test is run and have it refresh it's self when I
start the program up in the morning.
Ie:
test
1
2
3
4

After fifth test it would look like this:
test
2
3
4
5

and so on

I thank you in advance for all your help.

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top