Hi All,
I'm working on a master sheet which contains 50,000 users that belong to 140 departments. So I split them to 140 worksheets using this script:-
Sub SplitandFilterSheet()
Dim Splitcode As Range
Sheets("Master").Select
Set Splitcode = Range("Splitcode")
For Each Cell In Splitcode
Sheets("Master").Copy after:=Worksheets(Sheets.Count)
ActiveSheet.Name = Cell.Value
With ActiveWorkbook.Sheets(CStr(Cell.Value)).Range("MasterData")
.AutoFilter Field:=2, Criteria1:="<>" & Cell.Value, Operator:=xlFilterValues
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
ActiveSheet.AutoFilter.ShowAllData
Next Cell
End Sub
Then I save them as seperate CSV files using this script:-
Sub CreateNewWBS()
Dim wbThis As Workbook
Dim wbNew As Workbook
Dim ws As Worksheet
Dim strFilename As String
Set wbThis = ThisWorkbook
For Each ws In wbThis.Worksheets
strFilename = wbThis.Path & "/" & ws.Name
ws.Copy
Set wbNew = ActiveWorkbook
wbNew.SaveAs strFilename, xlCSVUTF8
wbNew.Close
Next ws
End Sub
My issue is that the master sheet has one column contains Arabic names and Two others Columns contain long numbers >15. So there are two Scenarios.
1-When I Save the files as xlCSVUTF8 the Arabic names are OK but Long numbers are converted in e.g. 9.71434E+14.
2- When I Save the files as xlCSVMac the long numbers are OK ( no scientific notation) but Arabic names are turned into ?????.
I have tried all the csv format but only UTF 8 accepts arabic.
Import Text wizard solution is not effective as I have so many files.
Is there any way to get all the csv files fixed and have Arabic names and numbers OK?
Thanks
Bookmarks