Results 1 to 9 of 9

No Error in Code but thee is no code execution

Threaded View

barillas1089 No Error in Code but thee is... 07-14-2016, 05:41 PM
Norie Re: No Error in Code but thee... 07-14-2016, 05:48 PM
barillas1089 Re: No Error in Code but thee... 07-14-2016, 06:10 PM
shg Re: No Error in Code but thee... 07-14-2016, 05:51 PM
Norie Re: No Error in Code but thee... 07-14-2016, 06:17 PM
barillas1089 Re: No Error in Code but thee... 07-14-2016, 06:24 PM
Norie Re: No Error in Code but thee... 07-14-2016, 06:31 PM
barillas1089 Re: No Error in Code but thee... 07-15-2016, 11:12 AM
barillas1089 Re: No Error in Code but thee... 07-21-2016, 06:45 PM
  1. #1
    Registered User
    Join Date
    07-13-2016
    Location
    CT
    MS-Off Ver
    2010
    Posts
    7

    No Error in Code but thee is no code execution

    I am pretty new to VBA but I really don't know why this code isn't working.

    I have a column that is always updated with new dates beginning with a new month and year which is then being provided a numeric value in another column on that same row.

    For example, for analysis of numbers for June-2016, June will be the first month in the column and be assigned 1. Then for the proceeding 12 months they are incremented by 1 and anything blank or after these 12 months is equal to x. (Feb-2016 = 2, Mar-2016 =3, Apr-2016 = 4....June-2017 =12). And as I mentioned for the next month of July-2016 this will now be assigned a 1 in another column and pattern continues. Will this require a number of different for loops within and if statement?

    The code is running with no errors but I don't see any execution of the code. Not sure if I have the if, for and case organized incorrectly?
    Any help with this and if possible in making the code more efficient would be greatly appreciated.

    Thanks

    Dim lngLoop As Long
    Dim x As String
    Dim L As String
    Dim D As Integer
    
    lngLoop = 1
    x = Sheets("Portfolio Matrix").Cells(1, 16).Value
    L = Sheets("Portfolio Matrix").Cells(lngLoop, 45).Value
    D = Sheets("Portfolio Matrix").Cells(lngLoop, 44).Value
    
    If x = July - 2016 Then
        
        For lngLoop = 1 To Rows.Count
    
            Select Case L
            Case "Jul-16"
                L = 2
            Case "Aug-16"
                L = 3
            Case "Sep-16"
                L = 4
            Case "Oct-16"
                L = 5
            Case "Nov-16"
                L = 6
            Case "Dec-16"
                L = 7
            Case "Nov-16"
                L = 8
            Case "Dec-16"
                L = 9
            Case "Jan-17"
                L = 10
            Case "Feb-17"
                L = 11
            Case "Mar-17"
                L = 12
            Case " "
                L = LT
            End Select
        Cells(lngLoop, 44).Value = result
            
        Next lngLoop
    Last edited by barillas1089; 07-14-2016 at 06:05 PM. Reason: Forum Rules

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with Reslving a VBA Code Execution Error
    By yegor2000 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-29-2014, 12:39 AM
  2. [SOLVED] VBA Code Error Upon Execution
    By MacroMan87 in forum PowerPoint Programming
    Replies: 4
    Last Post: 09-21-2013, 01:28 AM
  3. Code execution has been interrupted error on my macro file
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2012, 03:14 AM
  4. Automation Error At Odd Spot in Code Execution
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-02-2012, 11:50 AM
  5. Code execution has been interrupted error
    By vpnvipin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2012, 04:35 AM
  6. Error: Code Execution Has Been Interrupted
    By Xrull in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2010, 07:32 AM
  7. error: Code Execution has been interrupted
    By Joshua Fredrickson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2005, 11:50 AM

Tags for this Thread

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