Years together I was using a macro for automate a w/book is not as on today why?

tkraju

Board Regular
Joined
Apr 1, 2009
Messages
79
Office Version
  1. 2016
Platform
  1. Windows
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
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
What do you mean not running. Error messages, or what, or any clue? Also, tell whether you have altered any of the files involved, or changed computer, or installed a new version of Excel?
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,999
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top