View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bruno Bruno is offline
external usenet poster
 
Posts: 41
Default simple copy paste multiple range macro ARGUMENT ERROR

I need to copy a multiple range of cells and recalculate the values with the
new constants.
I got solved the copy part with some help, but now i can't get the paste
arguments right.

Here's the code

Sub CopyAndPasteV2()
For Each sht In Sheets
Select Case sht.Name
Case "D": SourceRow = -1
Case "A": SourceRow = 5
Case "B": SourceRow = 6
Case Else: SourceRow = 0
End Select

If SourceRow 0 Then
sht.Range("a6").EntireRow.Insert
Worksheets("INTRADAY").Rows(SourceRow).Copy
sht.Rows(6).PasteSpecial xlValues
sht.Range("C7:D7,J7:M7,P7:T7").Copy
sht.Range("C6:D6,J6:M6,P6:T6").xlPasteAll
End If

If SourceRow = -1 Then
sht.Range("a6").EntireRow.Insert
End If

Next sht
End Sub