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
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