Hi everyone,
first time on here and this place is so helpful. first time using VBA for excel and i have learnt everything i know so far from here! alas im still stuck!
So i have a worksheet with raw data on it called "Transient testpilot" and i have a calculation worksheet called "Hot-End". basically i want to take the first row of data andcopy it into specific fields in the "Hot-End" sheet. these feilds will then be used to generate results on the Hot-End sheet which i want to copy back to my raw data sheet to make a new column. once this is done i want the next row of raw data to be used untill the data is finished. i have tried many methods but all have resulted in errors. so i recorded a macro for simple copying and pasting for teh first set of data and then applied a simple "for..Next" loop. I changed what was originally Range("cell_location) to Cells(row,i), where i is a integer variable ranging from 10 to 1070 which is the range of my raw data.
so far this is the closest i have got. but i keep getting a error:
runtime error '1004' : paste method fo worksheet class failed
and for some reason even though the paste locations have beendefined by the recording, values are being pasted in random locations. ???
Sub transient()
'
' transient Macro
'
'
Dim i As Integer
For i = 10 To 1070
Sheets("Transient testpilot").Select
Cells(4, i).Select
Selection.Copy
Sheets("Hot-End ").Select
Range("A5").Select
ActiveSheet.Paste
Sheets("Transient testpilot").Select
Cells(7, i).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Hot-End ").Select
Range("C5").Select
ActiveSheet.Paste
Sheets("Transient testpilot").Select
Cells(11, i).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Hot-End ").Select
Range("B5").Select
ActiveSheet.Paste
Range("F29").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Transient testpilot").Select
Cells(13, i).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next i
End Sub
i need to get this working by tomorrow and i have been at it for hours. any help would be much appriciated! :D
cheers
first time on here and this place is so helpful. first time using VBA for excel and i have learnt everything i know so far from here! alas im still stuck!
So i have a worksheet with raw data on it called "Transient testpilot" and i have a calculation worksheet called "Hot-End". basically i want to take the first row of data andcopy it into specific fields in the "Hot-End" sheet. these feilds will then be used to generate results on the Hot-End sheet which i want to copy back to my raw data sheet to make a new column. once this is done i want the next row of raw data to be used untill the data is finished. i have tried many methods but all have resulted in errors. so i recorded a macro for simple copying and pasting for teh first set of data and then applied a simple "for..Next" loop. I changed what was originally Range("cell_location) to Cells(row,i), where i is a integer variable ranging from 10 to 1070 which is the range of my raw data.
so far this is the closest i have got. but i keep getting a error:
runtime error '1004' : paste method fo worksheet class failed
and for some reason even though the paste locations have beendefined by the recording, values are being pasted in random locations. ???
Sub transient()
'
' transient Macro
'
'
Dim i As Integer
For i = 10 To 1070
Sheets("Transient testpilot").Select
Cells(4, i).Select
Selection.Copy
Sheets("Hot-End ").Select
Range("A5").Select
ActiveSheet.Paste
Sheets("Transient testpilot").Select
Cells(7, i).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Hot-End ").Select
Range("C5").Select
ActiveSheet.Paste
Sheets("Transient testpilot").Select
Cells(11, i).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Hot-End ").Select
Range("B5").Select
ActiveSheet.Paste
Range("F29").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Transient testpilot").Select
Cells(13, i).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next i
End Sub
i need to get this working by tomorrow and i have been at it for hours. any help would be much appriciated! :D
cheers