I was using this macro for last 5 years, now it is not ru.nning
Sub UPDATE_SHEET()
'
' UPDATE_SHEET Macro
'
'
Application.WindowState = xlNormal
Windows("Nifty.xlsx").Activate
If Sheets("niftycsv").Range("A2").Value = Workbooks("Mkt_indices.xlsm").Sheets("nifty_sensex") _
.Range("B1").End(xlDown).Value Then
Windows("Mkt_indices.xlsm").Activate
Application.WindowState = xlMaximized
MsgBox "Data Already Exists", vbExclamation
Exit Sub
End If
Range("A2:E2").Select
Selection.Copy
Windows("Mkt_indices.xlsm").Activate
Range("G6").Select
Selection.End(xlDown).Select
Range("B1048576").Select
Selection.End(xlUp).Select
ActiveWindow.SmallScroll Down:=-5
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Offset(0, 0).PasteSpecial Paste:=xlPasteValues
Range("G7").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = " "
Windows("Sensex.xlsx").Activate
Range("A2:E2").Select
Selection.Copy
Windows("Mkt_indices.xlsm").Activate
Range("M6").Select
Selection.End(xlDown).Select
Range("H1048576").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Offset(0, 0).PasteSpecial Paste:=xlPasteValues
Range("M6").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = " "
Windows("Sensex.xlsx").Activate
Range("M7").Select
Windows("Nifty.xlsx").Activate
Range("F2").Select
Windows("Mkt_indices.xlsm").Activate
Application.WindowState = xlMaximized
Range("A1").Select
End Sub
Sub UPDATE_SHEET()
'
' UPDATE_SHEET Macro
'
'
Application.WindowState = xlNormal
Windows("Nifty.xlsx").Activate
If Sheets("niftycsv").Range("A2").Value = Workbooks("Mkt_indices.xlsm").Sheets("nifty_sensex") _
.Range("B1").End(xlDown).Value Then
Windows("Mkt_indices.xlsm").Activate
Application.WindowState = xlMaximized
MsgBox "Data Already Exists", vbExclamation
Exit Sub
End If
Range("A2:E2").Select
Selection.Copy
Windows("Mkt_indices.xlsm").Activate
Range("G6").Select
Selection.End(xlDown).Select
Range("B1048576").Select
Selection.End(xlUp).Select
ActiveWindow.SmallScroll Down:=-5
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Offset(0, 0).PasteSpecial Paste:=xlPasteValues
Range("G7").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = " "
Windows("Sensex.xlsx").Activate
Range("A2:E2").Select
Selection.Copy
Windows("Mkt_indices.xlsm").Activate
Range("M6").Select
Selection.End(xlDown).Select
Range("H1048576").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Offset(0, 0).PasteSpecial Paste:=xlPasteValues
Range("M6").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = " "
Windows("Sensex.xlsx").Activate
Range("M7").Select
Windows("Nifty.xlsx").Activate
Range("F2").Select
Windows("Mkt_indices.xlsm").Activate
Application.WindowState = xlMaximized
Range("A1").Select
End Sub