Updated my script and I feel like I'm getting close. After running the script with PHV's snippet, I got a Type Mismatch error on the line: If cell.Value > " " Then
My first thought is that I'm comparing text and the > will not work. So I thought to use StrComp instead. The conditional seems to work, but now I get a Type Mismatch error on my else statement. See my revised code below. I just can't get that darn Left command to work...
Set objExcel = CreateObject("Excel.Application")
objExcel.DisplayAlerts = False
strWB = "D:\content\SlotTournament."
Set objWorkbook = objExcel.Workbooks.Open(strWB & "xls")
objExcel.ActiveSheet.Rows("1:7").Delete
objExcel.ActiveSheet.Rows("26:65536").Delete
objExcel.ActiveSheet.Columns("A").Delete
objExcel.ActiveSheet.Columns("B:C").Delete
objExcel.ActiveSheet.Columns("C").Delete
objExcel.ActiveSheet.Columns("E").Delete
objExcel.ActiveSheet.Columns("F:H").Delete
Set objRange = objExcel.Range("D1").EntireColumn
For Each cell In objRange
str1 = cell.Value
str2 = " "
initCompare = StrComp(srt1, str2, vbTextCompare)
If initCompare = 0 Then
Exit For
Else
cell.Value = Left(cell.Value, 1)
End If
Next
Const xlCSV = 6
objExcel.ActiveWorkbook.SaveAs strWB & "csv", xlCSV
objWorkbook.Close
objExcel.Quit