pjmsimmons
Board Regular
- Joined
- Dec 13, 2011
- Messages
- 80
Hi All,
I am trying to create a reasonably complicated macro within an excel workbook. I might end up coming to the forum several times for help but this is my first question on the first part of what I'm trying to do.
I have a worksheet called 'blood' in which I select various cells in column B. For each x in my selection I wish to copy the cell content to a separate worksheet called 'Blood Report' if X.offset (0,9) = "1". The contents of the cell will be pasted into column B of the 'Blood Report ' worksheet starting at cell B65.
thus far I have
but I keep getting an error End IF Without Block If.
any help available?
regards,
Paul
I am trying to create a reasonably complicated macro within an excel workbook. I might end up coming to the forum several times for help but this is my first question on the first part of what I'm trying to do.
I have a worksheet called 'blood' in which I select various cells in column B. For each x in my selection I wish to copy the cell content to a separate worksheet called 'Blood Report' if X.offset (0,9) = "1". The contents of the cell will be pasted into column B of the 'Blood Report ' worksheet starting at cell B65.
thus far I have
Code:
Sub Test_Report()
Dim x As Range, lstrw As Long
lstrw = Sheets("Blood Report").Cells(Rows.Count, "B65").End(xlUp).Row
Application.ScreenUpdating = False
With Sheets("Blood")
For Each x In Selection
If x.Offset(0, 9) = "1" Then
With Sheets("Blood Report").Range("B65:B" & lstrw) = x
End If
Next x
End Sub
any help available?
regards,
Paul