Results 1 to 10 of 10

Excel not responding, for this code.

Threaded View

  1. #1
    Registered User
    Join Date
    04-09-2014
    Location
    bangalore
    MS-Off Ver
    2010
    Posts
    15

    Post Excel not responding, for this code.

    Hi guys,
    While running the following code,my excel is hanging. Not sure, what exactly is the problem, Please help.

    Option Explicit
    
    Sub bucket_range()
    
    Dim wb As Workbook
    Dim wmain As Worksheet
    Dim wrough As Worksheet
    Dim wpreinvpiv As Worksheet
    Dim i As Long
    Dim result As Variant
    Dim lastrow As Long
    Dim j As Long
    Dim k As Long
    Dim l As Long
    Dim pivot_rng As Range
    
    
    
    Set wb = Application.ActiveWorkbook
    Set wmain = wb.Sheets("main")
    Set wrough = wb.Sheets("main_rough")
    Set wpreinvpiv = wb.Sheets("Inv Prev Day Pivot")
    
    
    
    Range(Range("D4"), Range("d4").End(xlToRight)).Select
    
    Selection.ClearContents
    
    Set pivot_rng = wpreinvpiv.Range("A2:A1000")
    l = Application.Max(pivot_rng)
    wmain.Activate
    
    i = ActiveSheet.Cells(2, 3).Value
    j = 0
    k = 4
    
    Do Until k >= (Int(l / i) + 4)
        If k <= (Int(l / i) + 3) And (i * (j + 1)) <= l Then
        Cells(4, k).Value = i * j & "-" & i * (j + 1)
    Else: Cells(4, k).Value = i * j & "-" & "above"
    End If
    k = k + 1
    j = j + 1
    Loop
    
    
    End Sub
    Last edited by dinakar.yadav; 04-10-2014 at 07:35 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] "Not Responding" while code is running... need help with optimizing my code please!
    By dexcee in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2013, 12:33 AM
  2. Excel not responding
    By Brohein in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-30-2013, 02:15 AM
  3. [SOLVED] Excel 2010+ Workbook- running Module1 code – Not Responding
    By xladept in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 05-13-2013, 04:57 PM
  4. Excel 2007 : Excel Not Responding Help
    By Dave H in forum Excel General
    Replies: 2
    Last Post: 08-21-2009, 04:52 PM
  5. [SOLVED] Excel is not responding.
    By Rei in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 04-23-2006, 12:20 AM

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