Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Trupti Patil   on Sep 09 In MS Office Category.

  
Question Answered By: Rae Fischer   on Sep 09

Change ur range  to the below
Sub CopyAndPaste()



Dim x As Integer
Dim y As Integer
Dim z As Integer

x = Worksheets(1).UsedRange.Rows.Count
y = Worksheets(2).UsedRange.Rows.Count + 1
z = x + y

Sheets("Sheet1").Select
Range("B1", "D" & x).Select //Changed
Selection.Copy

Sheets("Sheet2").Select
Range("A" & y, "C" & x + 1).Select //Changed
ActiveSheet.Paste
End Sub

Note: altered ur Range("A" & y, "C" & x + 1).Select since the destined
range exceeds the source range

Share: 

 
 
Didn't find what you were looking for? Find more on Help needed with Range Copy and Paste Or get search suggestion and latest updates.


Tagged: