aabnormal
09-22-2008, 11:47 AM
Hello All!
Once again I could use a little assistance. I am looking to run a sorting sub that I have listed as a public sub (Copy_Confirms) if the column is empty. The issue that I am having is that my If..Then statement seems to be incorect as the Copy_Confirms statement is running whether the test is true or false.
I know that determining empty columns can be tricky and so I have tried using IsEmpty, as well as worksheet function CountA > 0 . I have also deleted the entire column, cleared all contents and yet the Copy_Confirms sub is still running when the column is empty. Any idea why?? Thanks in advance.
Sub macro3()
Sheets("Invoice Analysis").Select
If IsEmpty("O1:O65536") = False Then
Copy_Confirms
Else
Selection.Sort Key1:=Range("N1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
End If
End Sub
Once again I could use a little assistance. I am looking to run a sorting sub that I have listed as a public sub (Copy_Confirms) if the column is empty. The issue that I am having is that my If..Then statement seems to be incorect as the Copy_Confirms statement is running whether the test is true or false.
I know that determining empty columns can be tricky and so I have tried using IsEmpty, as well as worksheet function CountA > 0 . I have also deleted the entire column, cleared all contents and yet the Copy_Confirms sub is still running when the column is empty. Any idea why?? Thanks in advance.
Sub macro3()
Sheets("Invoice Analysis").Select
If IsEmpty("O1:O65536") = False Then
Copy_Confirms
Else
Selection.Sort Key1:=Range("N1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
End If
End Sub