Hey guys, I'm really new to the world of Excel and I'm trying to organize a table and convert it into something that could be used for an SQL database. Now what i'm trying to do is sort through Numbers and Currency values, to obtain and move only the Number values not the currency values.
Sub Sort()
Dim ordernum, c
Set ordernum = Range("G738:R788")
counter = 1
cnt = 1
n = 736
For Each c In ordernum
If IsNumber(ordernum) Then
'This Line Above the Comment is what I need.
If c.Value < 0 Then
Selection.Cells(cnt, -1).Value = Cells(n, 6)
Selection.Cells(cnt, 1).Value = c.Value
If counter = 1 Then
Selection.Cells(cnt, 0).Value = "05/1/2005"
ElseIf counter = 2 Then
Selection.Cells(cnt, 0).Value = "06/1/2005"
ElseIf counter = 3 Then
Selection.Cells(cnt, 0).Value = "07/1/2005"
ElseIf counter = 4 Then
Selection.Cells(cnt, 0).Value = "08/1/2005"
ElseIf counter = 5 Then
Selection.Cells(cnt, 0).Value = "09/1/2005"
ElseIf counter = 6 Then
Selection.Cells(cnt, 0).Value = "10/1/2005"
ElseIf counter = 7 Then
Selection.Cells(cnt, 0).Value = "11/1/2005"
ElseIf counter = 8 Then
Selection.Cells(cnt, 0).Value = "12/1/2005"
ElseIf counter = 9 Then
Selection.Cells(cnt, 0).Value = "1/1/2005"
ElseIf counter = 10 Then
Selection.Cells(cnt, 0).Value = "2/1/2005"
ElseIf counter = 11 Then
Selection.Cells(cnt, 0).Value = "3/1/2005"
ElseIf counter = 12 Then
Selection.Cells(cnt, 0).Value = "4/1/2005"
End If
cnt = cnt + 1
ElseIf c.Value > 0 Then
Selection.Cells(cnt, 1).Value = c.Value
Selection.Cells(cnt, -1).Value = Cells(n, 6)
If counter = 1 Then
Selection.Cells(cnt, 0).Value = "05/1/2005"
ElseIf counter = 2 Then
Selection.Cells(cnt, 0).Value = "06/1/2005"
ElseIf counter = 3 Then
Selection.Cells(cnt, 0).Value = "07/1/2005"
ElseIf counter = 4 Then
Selection.Cells(cnt, 0).Value = "08/1/2005"
ElseIf counter = 5 Then
Selection.Cells(cnt, 0).Value = "09/1/2005"
ElseIf counter = 6 Then
Selection.Cells(cnt, 0).Value = "10/1/2005"
ElseIf counter = 7 Then
Selection.Cells(cnt, 0).Value = "11/1/2005"
ElseIf counter = 8 Then
Selection.Cells(cnt, 0).Value = "12/1/2005"
ElseIf counter = 9 Then
Selection.Cells(cnt, 0).Value = "1/1/2005"
ElseIf counter = 10 Then
Selection.Cells(cnt, 0).Value = "2/1/2005"
ElseIf counter = 11 Then
Selection.Cells(cnt, 0).Value = "3/1/2005"
ElseIf counter = 12 Then
Selection.Cells(cnt, 0).Value = "4/1/2005"
End If
cnt = cnt + 1
End If
counter = counter + 1
End If
n = n + 5
Next c
End Sub
So basicly i know the code itself is a mess, I can live with that but i really wanna know how to tell the difference between a currency value and a number value. Please help
thanks
rob
Bookmarks