|  
                                             
	Hallo zusammen, 
	Ich habe folgendes Problem: Ich habe ein recht komplexes VBA Script im Rahmen meiner Dissertation erstellt. Das Script lief bisher auf allen möglichen Rechnern (PCs Laptops, neu/alt) gut, je nach CPU unterschiedlich schnell. Nun habe ich einen neuen Laptop (Octacore i7-4720HQ @ 2,6) mit SSD und das script läuft um ein vielfaches langsamer. Bsp: Ein bestimmer Rechenschritt braucht auf meinem alten Laptop ca. 1 Minute, am neuen ca. 10 Minuten. Es auf beiden Laptops Win 7 64 bit Prof und Office 2010 64bit installiert. Zuerst war auf dem neuen Laptop Office 2013 drauf und ich dachte es liegt daran und habe dann das 2010er installiert. Hat aber nichts geändert. 
	Mir scheint, dass es vor allem for...next Schleifen betrifft, die nun deutlich langsamer laufen. Ich habe mal so eine Schleife hierhin kopiert, wobei ich nicht denke, dass es am script liegt, da es ja auf einem älteren System (gleiche Datei etc) besser funktioniert. 
	i läuft ca. 10000 mal durch. 
	Bin für jegliche Hilfe/Tipps dankbar! 
	  
	For i = 1 To leZeile - 1 
	 With Workbooks(1).Worksheets(sheetname) 
	    tmin = .Cells(i + 1, 9) 
	    tmax = .Cells(i + 1, 10) 
	    jday = .Cells(i + 1, 5) 
	    If tmin = 9999 Or tmax = 9999 Then 
	        tmean = 9999 
	        Else: tmean = (tmin + tmax) / 2 
	    End If 
	    .Cells(i + 1, 11) = tmean 
	    If month_col = 0 Then 
	        If jday >= 1 And jday <= 31 Then 
	            month = 1: day = jday 
	        ElseIf jday >= 32 And jday <= 59 Then 
	            month = 2: day = jday - 31 
	        ElseIf jday >= 60 And jday <= 90 Then 
	            month = 3: day = jday - 59 
	        ElseIf jday >= 91 And jday <= 120 Then 
	            month = 4: day = jday - 90 
	        ElseIf jday >= 121 And jday <= 151 Then 
	            month = 5: day = jday - 120 
	        ElseIf jday >= 152 And jday <= 181 Then 
	            month = 6: day = jday - 151 
	        ElseIf jday >= 182 And jday <= 212 Then 
	            month = 7: day = jday - 181 
	        ElseIf jday >= 213 And jday <= 243 Then 
	            month = 8: day = jday - 212 
	        ElseIf jday >= 244 And jday <= 273 Then 
	            month = 9: day = jday - 243 
	        ElseIf jday >= 274 And jday <= 304 Then 
	            month = 10: day = jday - 273 
	        ElseIf jday >= 305 And jday <= 334 Then 
	            month = 11: day = jday - 304 
	        ElseIf jday >= 335 And jday <= 365 Then 
	            month = 12: day = jday - 334 
	        Else: MsgBox "JDAY not valid" 
	        End If 
	        .Cells(i + 1, 1).Value = day 
	        .Cells(i + 1, 2).Value = month 
	    End If 
	    datum = .Cells(i + 1, 1).Value & "." & .Cells(i + 1, 2).Value 
	    .Cells(i + 1, 4).Value = datum 
	    If .Cells(i + 1, 8) = 9999 Then 
	        If i > 1 Then 
	            If .Cells(i + 1, 7) < 9999 Then 
	                pseudo_snow = .Cells(i + 1, 7) - .Cells(i, 7) 
	                If pseudo_snow >= 0 Then 
	                    .Cells(i, 8) = pseudo_snow 
	                Else: .Cells(i, 8) = 0 
	                End If 
	            End If 
	        End If 
	    End If 
	  End With 
	Next i 
	  
	Lg, Robert 
     |