Forum

Looking to make thi...
 
Notifications
Clear all

Looking to make this macro Faster

2 Posts
2 Users
0 Reactions
62 Views
(@leonardo1234)
Posts: 26
Eminent Member
Topic starter
 

Sub STEP15() Dim r As Long Dim m As Long Dim wb1 As Workbook Set wb1 = Workbooks.Open("C:UsersWolfieeeStyleDesktopHotStocks1.xls") Set ws1 = wb1.Worksheets.Item(1) Application.ScreenUpdating = False With ws1 m = .Range("A" & .Rows.Count).End(xlUp).Row For r = 2 To m If .Range("H" & r).Value < .Range("D" & r).Value Then .Range("K" & r).Value = Application.Ceiling(.Range("K" & r).Value, 0.05) .Range("K" & r).NumberFormat = "0.00" Else .Range("K" & r).Value = Application.Floor(.Range("K" & r).Value, 0.05) .Range("K" & r).NumberFormat = "0.00" End If Next r End With Application.ScreenUpdating = True wb1.Save wb1.Close End Sub

 
Posted : 26/09/2020 2:48 am
Philip Treacy
(@philipt)
Posts: 1631
Member Admin
 

Hi Sholtan,

As I've asked you on other posts, please supply the workbook(s).  Impossible to do anything without the data this code operates with.

Please define faster. 

How slow is this code? 

How fast do you expect it to be?

Phil

 
Posted : 26/09/2020 3:07 am
Share: