Hi Guys,
Probably an easy one but I cant get the following to work...
I have a download from a system which gives my a bunch of data. Out of this data I'd like to create a template. The template is a copy of the data when the cell value in column B is a number.
The following code will copy everything, also when B.. has text in it. Where do I go wrong?
Probably an easy one but I cant get the following to work...
I have a download from a system which gives my a bunch of data. Out of this data I'd like to create a template. The template is a copy of the data when the cell value in column B is a number.
The following code will copy everything, also when B.. has text in it. Where do I go wrong?
Code:
Sub Create_Template()
On Error Resume Next
r = 5
For Each Cell In Range("B1:B1000")
If 1 / Cell.Value > 0 Then
Worksheets("Template").Cells(r, 2).Value = Cell.Value
Worksheets("Template").Cells(r, 3).Value = Cell.Offset(0, 1).Value
Worksheets("Template").Cells(r, 4).Value = Cell.Offset(0, 4).Value
End If
r = r + 1
Next Cell
End Sub