Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel vba script extremely slow


Hello

I have strange problem with this vba script
Values in cells are numeric or string like 1, a2, aa, 3 etc.
Each loop takes ~10sec on 2.5 GHz Pentium


Code
-------------------

Dim column As Integer
Dim row As Integer
Dim value As String
Application.ScreenUpdating = False
For column = 4 To 44
value = Cells(row,column ).Value
MsgBox (value)
Next sarake
Application.ScreenUpdating = True

-------------------


Any suggestions on how to make it run faster ?

Nevermind I got it workin :D stupid m

--
persenen
-----------------------------------------------------------------------
persenena's Profile: http://www.excelforum.com/member.php...fo&userid=2491
View this thread: http://www.excelforum.com/showthread.php?threadid=38448

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Excel vba script extremely slow

Apart from the fact that the For ... Next loop seems ill-constructed and ro
is not set, surely, it is the Msgbox that makes it slow, haviun g to respond
each time? The data processed is sm all so it should be quick in essence.
Also, not a good idea to have variables called row, column, value. Try this

Dim iCol As Integer
Dim iRow As Integer
Dim myValue As String
Application.ScreenUpdating = False
iRow = 1
For iCol = 4 To 44
myValue = myValue = Cells(iRow,iCol).Value & vbNewline
Next iCol
Application.ScreenUpdating = True
MsgBox (myValue)

--
HTH

Bob Phillips

"persenena" wrote
in message ...

Hello

I have strange problem with this vba script
Values in cells are numeric or string like 1, a2, aa, 3 etc.
Each loop takes ~10sec on 2.5 GHz Pentium


Code:
--------------------

Dim column As Integer
Dim row As Integer
Dim value As String
Application.ScreenUpdating = False
For column = 4 To 44
value = Cells(row,column ).Value
MsgBox (value)
Next sarake
Application.ScreenUpdating = True

--------------------


Any suggestions on how to make it run faster ?

Nevermind I got it workin :D stupid me


--
persenena
------------------------------------------------------------------------
persenena's Profile:

http://www.excelforum.com/member.php...o&userid=24910
View this thread: http://www.excelforum.com/showthread...hreadid=384484



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Excel vba script extremely slow

Sorry typo.

BTW, it was too fast to clock on my 2Mhz system

Dim iCol As Integer
Dim iRow As Integer
Dim myValue As String
Application.ScreenUpdating = False
iRow = 1
For iCol = 4 To 44
myValue = myValue & Cells(iRow, iCol).Value & vbNewLine
Next iCol
Application.ScreenUpdating = True
MsgBox (myValue)


--
HTH

Bob Phillips

"persenena" wrote
in message ...

Hello

I have strange problem with this vba script
Values in cells are numeric or string like 1, a2, aa, 3 etc.
Each loop takes ~10sec on 2.5 GHz Pentium


Code:
--------------------

Dim column As Integer
Dim row As Integer
Dim value As String
Application.ScreenUpdating = False
For column = 4 To 44
value = Cells(row,column ).Value
MsgBox (value)
Next sarake
Application.ScreenUpdating = True

--------------------


Any suggestions on how to make it run faster ?

Nevermind I got it workin :D stupid me


--
persenena
------------------------------------------------------------------------
persenena's Profile:

http://www.excelforum.com/member.php...o&userid=24910
View this thread: http://www.excelforum.com/showthread...hreadid=384484



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Extremely Slow KMH Excel Discussion (Misc queries) 2 June 30th 09 01:27 PM
Extremely slow subtotals in Excel 2003 GARY Excel Discussion (Misc queries) 3 April 16th 07 09:21 PM
Excel extremely slow opening ChrisW (MCP) Setting up and Configuration of Excel 2 March 23rd 07 07:16 PM
Excel and Word EXTREMELY slow to open Tom_in_Jersey Excel Discussion (Misc queries) 4 January 31st 07 10:05 PM
Excel extremely slow opening and using domestic911 Excel Discussion (Misc queries) 2 January 26th 05 08:51 PM


All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"