+ Reply to Thread
Results 1 to 2 of 2

Excel is SLOW when using Save, Paste, Bold or Copy.

Hybrid View

  1. #1
    Forum Contributor ebin charles's Avatar
    Join Date
    03-31-2010
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    255

    Excel is SLOW when using Save, Paste, Bold or Copy.

    Hey!

    I am working man hours calculation in excel which comes around
    8500 rows and 250 columns in a sheet.
    When I try to run a macro or any function (as Save, Paste, Bold or Copy) it
    is dead slow and takes an hour for whatever functions.

    I have Dell optiplex 790, i3-2.42 with 4 GB RAM with good speed.
    I have Macro settings to "Enable all macros (not recommended...... and Truste all VBA project model...

    Please some genius help me what is the problem or any settings I need to change or any mistake I am doing...?

    below is my macro:
    Option Explicit
    
    Sub CommandButton1_Click()
    Dim i As Integer
    Dim j As Integer
    'Double Shift
    Dim X1 As String
    Dim X2 As String
    Dim X3 As String
    Dim X4 As String
    
    For i = 10 To 8371
    X1 = Me.Cells(i, 1)
    X2 = Me.Cells(i, 2)
    
    For j = 10 To 8371
    
    
    X3 = Me.Cells(j, 1)
    X4 = Me.Cells(j, 2)
    If X1 = X3 And X2 = X4 And j <> i Then
    Range("DJ" & j & ":" & "DM" & j).Interior.Color = RGB(0, 5900, 0)
    End If
    
    Next
    Next
    
    End Sub
    Sub HideCol()
    ' hides the columns marked with an X
        Showcol
        Rows("2:2").SpecialCells(xlCellTypeFormulas, 22).EntireColumn.Hidden = True
    End Sub
    Sub Showcol()
        Cells.EntireColumn.Hidden = False
    End Sub
    
    Sub Flip()
    ' thanks to Roger Govier for suggesting this macro
    '   that hides the unmarked columns (those with a zero instead of an X)
      Showcol
      Rows("2:2").SpecialCells(xlCellTypeFormulas, 21).EntireColumn.Hidden = True
      HideCol
    End Sub
    Sub Button2_Click()
    Dim X1 As Integer
    Dim X2 As Integer
    Dim X3 As Integer
    
    Dim X4 As Integer
    Dim na1 As String
    Dim na2 As String
    
    Dim date1 As String
    Dim date2 As String
    
    Dim thod As String
    'list of employees made for OT list after all calculation in right side
    For X1 = 8 To 342
    'column number which creteria name + number lies
    na2 = Me.Cells(X1, 135)
    'within this column full month from 01.01.10 to 31.01.10)
    For X2 = 170 To 200
    'row number where all heading lies
    date2 = Me.Cells(7, X2)
    'this is entire calculation total number of which lies in column "A"
    For X4 = 8 To 8371
    
    date1 = Me.Cells(X4, 1)
    na1 = Me.Cells(X4, 2)
    'MsgBox (" -0- " & na1 & " -1-  " & na2 & " -2-  " & date1 & " -3- " & date2)
    If na2 = na1 And date2 = date1 And Me.Cells(X1, X2) = "" Then
    Me.Cells(X1, X2) = Me.Cells(X4, 235)
    
    ElseIf na2 = na1 And date2 = date1 And Me.Cells(X1, X2) <> "" Then
    Me.Cells(X1, X2) = Me.Cells(X1, X2) & "/" & Me.Cells(X4, 235)
    End If
    Next
    Next
    NextEnd Sub
    Regards,
    Charles P
    Last edited by pike; 02-04-2012 at 02:53 AM.

  2. #2
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Excel is SLOW when using Save, Paste, Bold or Copy.

    When I try to run a macro or any function (as Save, Paste, Bold or Copy) it is dead slow and takes an hour for whatever functions.
    So the problem is not just running the macro's? Does the page have a lot of formulas especially array formulas. If you hit Ctrl ` (under the tilde key) it will show all your formulas in the sheet. Try turning off automatic calculation of the sheet and make it manual and see if it makes a difference.

    Hope this helps.
    Anthony
    “Confidence never comes from having all the answers; it comes from being open to all the questions.”
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated
    Last edited by smuzoen; 02-04-2012 at 05:18 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1