Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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....... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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....... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "John Bundy" wrote: 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....... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? -- -John Please rate when your question is answered to help us and others know what is helpful. "Eric" wrote: 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 "John Bundy" wrote: 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....... |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "John Bundy" wrote: 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? -- -John Please rate when your question is answered to help us and others know what is helpful. "Eric" wrote: 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 "John Bundy" wrote: 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....... |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 Please rate when your question is answered to help us and others know what is helpful. "Eric" wrote: 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 "John Bundy" wrote: 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? -- -John Please rate when your question is answered to help us and others know what is helpful. "Eric" wrote: 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 "John Bundy" wrote: 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....... |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. -- Gary''s Student - gsnu200755 "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....... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
Automating copy/paste/paste special when row references change | Excel Programming | |||
help w/ generic copy & paste/paste special routine | Excel Programming | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
Copy and Paste macro needs to paste to a changing cell reference | Excel Programming |