tcemmdll5000 - Home Currency functions
tcemmdll5010 - Multi Currency Operations
tcemmdll5015 - Multi Currency Operations (only for tf)
tcemmdll5010 - Multi Currency Operations
tcemmdll5015 - Multi Currency Operations (only for tf)
Sub details()
Dim sh1 As Worksheet
Dim newsh1 As Worksheet
Dim newwb As Workbook
Dim i, totalrows As Integer
Dim j As Integer
Dim newfile As String
Dim sortcol As String
Dim folderpath As String
sortcol = InputBox("Enter the Column Number based on which u want to split the Excel. Eg. A")
folderpath = InputBox("Enter path to store split files. Eg. C:\folderName\")
Set sh1 = ThisWorkbook.Sheets("Sheet1")
sh1.Range(sortcol + "1").Sort Key1:=sh1.Range(sortcol + "1"), Order1:=xlAscending, Header:=xlNo
totalrows = sh1.Range(sortcol + "1", sh1.Range(sortcol + "1").End(xlDown)).Rows.Count
newfile = ""
j = 0
For i = 1 To totalrows
If newfile = sh1.Range(sortcol + CStr(i)) Then
j = j + 1
newsh1.Range("A" + CStr(j) + ":Z" + CStr(j)) = sh1.Range("A" + CStr(i) + ":Z" + CStr(i)).Value
Else
If newfile <> "" Then
newwb.Save
newwb.Close
End If
newfile = sh1.Range(sortcol + CStr(i)).Value
Set newwb = Workbooks.Add
j = 0
With newwb
.SaveAs Filename:=folderpath + newfile + ".xlsx"
Set newsh1 = .Sheets("Sheet1")
End With
j = j + 1
newsh1.Range("A" + CStr(j) + ":Z" + CStr(j)) = sh1.Range("A" + CStr(i) + ":Z" + CStr(i)).Value
End If
Next i
If newfile <> "" Then
newwb.Save
newwb.Close
End If
End Sub
This macro is dynamic enough to handle any similar excel requirement of yours.