Copy and paste areas different sizes

Wedne5day1te

New Member
Joined
Aug 5, 2018
Messages
7
I have a worksheet with data in multiple columns, only someof which I need to select. The routineworks fine when all the cells in the range are populated but where there is nosale against a product some of the rows are blank.
For each product code I am selecting the 2 columns MyColFand MyColF1 and copying the sales to the “Out” sheet into the first blank cell inthe column.
Error is copy and paste areas are not the same size. I wouldappreciate any guidance on this.
----------------------
Private Sub Sold()
Dim MyColF As Integer
Dim MyColF1 As Integer
Dim Out As Worksheet
Dim ActSheet As Worksheet
Const FR = 77
Const LR = 88

Set ActSheet =ActiveSheet
MyColF =ActiveCell.Column
MyColF1 = MyColF +1
ActSheet.Range(MyColF & FR & ":" & MyColF1 &LR).Copy
With Sheets("Out")
.Range("E" & .Rows.Count).End(xlUp).Offset(1).PasteSpecialPaste:=xlPasteValues, _
Operation:=xlNone,SkipBlanks:=False, Transpose:=False
End With
EndSub
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
perhaps

.Range("E" & .Rows.Count).End(xlUp).Offset(1).Resize(12,2)
 
Upvote 0
Dou you have any merged cells in either of those sheets?
 
Upvote 0

Forum statistics

Threads
1,215,783
Messages
6,126,876
Members
449,346
Latest member
Janspook03

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top