Hi,
I'm trying to get a range from Sheet A based on some criteria and paste it to a newly added sheet with headings.
Wonder if someone can tell me what's wrong with the following: I'm not sure if there is such a thing as SourceSheet.
Any help is greatly appreciated!!!
Thanks much!!!!
Suki
Dim myNum As String
Dim SourceSheet As Worksheet
Dim x As Integer
Dim iRow As Long
Range("Z800").Select
myNum = Application.InputBox("Enter check deposit date eg dd/mm/yy")
ActiveCell.FormulaR1C1 = myNum
Range("C2:C1000").Select
Cells.Find(What:=myNum, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False).Activate
Range(Cells(iRow, 2), _
Cells(1000, 5)).Copy
Range("B1001").Select
ActiveSheet.Paste
Set SourceSheet = ActiveSheet
Application.Worksheets.Add
'Populate the heading description
Range("A1") = "Check Reference"
Range("B1") = "Check Amount"
Range("A2") = "Example"
Range("A2").Copy
Range("B2").PasteSpecial
Cells(1, 1).Select
ActiveCell.End(xlDown).Select
iRow = ActiveCell.Row + 1
For x = 1001 To 2000
If .Range("B" & x) <> "GIRO" And .Range("B" & x) <> "" Then
.Range("A" & iRow) = .Range("B" & x) 'check #
.Range("B" & iRow) = .Range("E" & x) 'Ck Amt
End If
iRow = iRow + 1
Next