Sign in to follow this  
Followers 0

excel 2013 performance issue

4 posts in this topic

Posted

Hey so I have a simple code I am using in excel. office 2010 ran through the code in seconds. 2013, takes forever... the code is really simple, I am including it here.


Sub M72_M73()

Dim i, j As Integer

Dim minM72, minM73 As Integer

Dim minB44 As Double

minM72 = ThisWorkbook.ActiveSheet.Cells(72, 13)

minM73 = ThisWorkbook.ActiveSheet.Cells(73, 13)

minB44 = ThisWorkbook.ActiveSheet.Cells(44, 2)

For i = 0 To 100

	For j = 0 To 100 Step 5

		ThisWorkbook.ActiveSheet.Cells(72, 13) = i / 100 '13 means M

		ThisWorkbook.ActiveSheet.Cells(73, 13) = j / 100 '13 means M

		DoEvents

		If (ThisWorkbook.ActiveSheet.Cells(44, 2) < minB44) Then

			minM72 = i

			minM73 = j

			minB44 = ThisWorkbook.ActiveSheet.Cells(44, 2)

		End If

	Next j

Next i

ThisWorkbook.ActiveSheet.Cells(72, 13) = minM72 / 100

If minM72 = 0 Then

	For i = 0 To 100

		ThisWorkbook.ActiveSheet.Cells(73, 13) = i / 100

		DoEvents

		If (ThisWorkbook.ActiveSheet.Cells(44, 2) < minB44) Then

			minM73 = i

		End If

	Next i

End If

ThisWorkbook.ActiveSheet.Cells(73, 13) = minM73 / 100

DoEvents

End Sub

Any idea why this is taking much much longer in office 2013? I would hate to have to switch back to 2010.

Share this post


Link to post
Share on other sites

Posted

if you google vba excel 2013 performance, there are loads of similar queries... all without answers.

i have a good mind to think it's been done on purpose to ween people off of VBA! haha

sorry, i know it's not much help :(

also, i just ran it and it seems to run very quickly in my Excel 2013... what does 'DoEvents' actually do?

can you provide a workbook with sample data at all ?

Share this post


Link to post
Share on other sites

Posted (edited)

ween people off of VBA??? oh no! it's so easy...

DoEvent writes the number into those cells and a bunch of cells dynamically update until the final cost is calculated and compared to the old cost.

I can't share the file since it's confidential information. I have a 365 subscription so I will bug MS till I get an answer.

updates: I found a few updates that really improved performance. it's still not where office 2010 was but it's usable now.

Edited by capr

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.