S
Sentos
Hi,
Im creating a financial projection worksheet but haven't decided on when
each product will launch.
I want C6 value if = 1 to copy E55 and paste at E55
if C6 = 2 copy E55 and paste at f5:q5
if C6 = 3 copy E55 and paste at g5:r5
ect
THis is the code I came up with:
Sub Macro1()
Sheets("Revenue table").Select
cval = Range("C6")
Sheets("OpenCAM Quarterly Projections").Select
Range("E55").Select
Selection.Clear
Range("E5").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
If cval = 1 Then
Range("E5").Select
ActiveSheet.Paste
ElseIf cval = 2 Then
Range("F5").Select
ActiveSheet.Paste
ElseIf cval = 3 Then
Range("G5").Select
ActiveSheet.Paste
End If
End Sub
It runs fine when value =1 but anything else it has an error msg.
Error msg: Run-time error 1004
click a single cell, and then paste
or select a rectangle that's te same size and shape, then paste
Can anyone please help?
Im creating a financial projection worksheet but haven't decided on when
each product will launch.
I want C6 value if = 1 to copy E55 and paste at E55
if C6 = 2 copy E55 and paste at f5:q5
if C6 = 3 copy E55 and paste at g5:r5
ect
THis is the code I came up with:
Sub Macro1()
Sheets("Revenue table").Select
cval = Range("C6")
Sheets("OpenCAM Quarterly Projections").Select
Range("E55").Select
Selection.Clear
Range("E5").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
If cval = 1 Then
Range("E5").Select
ActiveSheet.Paste
ElseIf cval = 2 Then
Range("F5").Select
ActiveSheet.Paste
ElseIf cval = 3 Then
Range("G5").Select
ActiveSheet.Paste
End If
End Sub
It runs fine when value =1 but anything else it has an error msg.
Error msg: Run-time error 1004
click a single cell, and then paste
or select a rectangle that's te same size and shape, then paste
Can anyone please help?