KenndovinA
New member
Hello there,
have one issue, and hope that someone from this forum can help me...
When I export data's from some application, it gives me excel file with alot of information.
Former IT employee have made Macro, who served to sort the data.
Few days ago, application is updated, and probably changed some of the export data, and Macro does not sort data as before.
So can someone check out code and see what should be changed, so after his run sort data as before?
So the old Macro code is:
Also, in attachment you can find non fixed and some old fixed file.
View attachment non fixed data.xls
View attachment old fixed data.xls
Thanx in advance! :israel:
have one issue, and hope that someone from this forum can help me...
When I export data's from some application, it gives me excel file with alot of information.
Former IT employee have made Macro, who served to sort the data.
Few days ago, application is updated, and probably changed some of the export data, and Macro does not sort data as before.
So can someone check out code and see what should be changed, so after his run sort data as before?
So the old Macro code is:
Sub MacroZaFlightListImproved()
'
' Makro za Flight List za Air Serbia
'
' Shortcut: CTRL + j
'
MsgBox "FlightList Procedure" & vbNewLine & "with UPPERCASE upgrade" & vbNewLine & "Version 5.1 (14.06)"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Data Validation
Dim RightNow As Date
Dim objDate As Date
'Set Objective Date
objDate = CDate("2/10/2035")
Application.ScreenUpdating = False
RightNow = Functions.InternetDate()
If RightNow > objDate Then
MsgBox ("Run-time error '400':" & vbNewLine & vbNewLine & "Data Validation Error"), , "Error Encountered"
GoTo EndMac:
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Columns("A:A").Select
Selection.Insert Shift:=xlToLeft, CopyOrigin:=xlFormatFromLeftOrAbove
Dim R As Integer
Dim i As Long
Dim Row As Long
Dim V As Variant
Dim Rng As Range
Dim Col As Variant
On Error GoTo EndMacro
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
'
' Sredjivanje Mr, Ms, Mrs, Chd, Inf
'
Set Rng = Application.Intersect(ActiveSheet.UsedRange, ActiveSheet.Columns("C"))
For i = 2 To Rng.Rows.Count Step 1
Application.StatusBar = "Processing Row" & R
If Cells(i, "D") Like "Mr" Or Cells(i, "D") Like "Ms" Or Cells(i, "D") Like "Mrs" Then
Cells(i, "A").Value = "1" + Cells(i, "E").Value + "/" + Cells(i, "F").Value
Else
If Cells(i, "D") Like "Chd" Then
Cells(i, "A").Value = "1" + Cells(i, "E").Value + "/" + Cells(i, "F").Value + " CHLD " + Cells(i, "G").Value
Else
If Cells(i, "D") Like "Inf" Then
Cells(i, "A").Value = ".R/INFT " + Cells(i, "E").Value + "/" + Cells(i, "F").Value + " " + Cells(i, "G").Value
End If
End If
End If
Next i
Cells("2", "A").Value = Cells(2, "C").Value + " " + Cells(5, "C").Value
Range("B2").Select
Selection.Cut
Range("B52").Select
Selection.Cut
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft
Columns("F:X").Select
Selection.Delete Shift:=xlToLeft
Columns("A:A").EntireColumn.AutoFit
EndMacro:
' Loop to cycle through each cell in the specified range.
For Each x In Range("A1:A200")
' Change the text in the range to uppercase letters.
x.Value = UCase(x.Value)
Next
'
' Razmaci po broju prijava
'
Col = C
Set Rng = Application.Intersect(ActiveSheet.UsedRange, ActiveSheet.Columns("C"))
For R = Rng.Rows.Count To 2 Step -1
Application.StatusBar = "Processing Row" & R
If Rng.Cells(R, Col) <> 0 Then
If Rng.Cells(R - 1, Col) <> Rng.Cells(R, Col) Then
'Rng.Rows(R).EntireRow.Delete
'MsgBox "Trenutni Br. Prijave" & Rng.Cells(R, Col) & " Predhodni Br. Prijave" & Rng.Cells(R - 1, Col)
Rng.Cells(R, Col).EntireRow.Insert Shift:=xlDown
End If
End If
Next R
Application.StatusBar = "Macro by Marko. Version 2016"
EndMac:
End Sub
Also, in attachment you can find non fixed and some old fixed file.
View attachment non fixed data.xls
View attachment old fixed data.xls
Thanx in advance! :israel: