+ Reply to Thread
Results 1 to 3 of 3

VBA Code works with step (f8) not run <ctrl>f8

Hybrid View

  1. #1
    Registered User
    Join Date
    01-07-2010
    Location
    Madison, WI
    MS-Off Ver
    Excel 2003
    Posts
    11

    VBA Code works with step (f8) not run <ctrl>f8

    Hello All,
    WIN 7 Excel 2010
    I have some code that I can get to run by stepping through but not by running macro. HELP!

    code is searching for slope of a linear trendline after making chart. When it runs it errors out at the line starting with XMARK because it has NOT written the equation for the line (.DataLabel.Text)



    Worksheets("Graph1").Activate
        
    With Worksheets("Graph1").ChartObjects(1).Chart.SeriesCollection(1).Trendlines(1)
        
        
        Worksheets("Graph1").Activate
        Worksheets("Graph1").Cells(25, 4).Select
        Selection.Value = .DataLabel.Text
        End With
            Worksheets("Graph1").Cells(26, 4) = Mid(Worksheets("Graph1").Cells(25, 4), 5, 100)
             xmark = Application.WorksheetFunction.Find("x", Worksheets("Graph1").Cells(26, 4), 1)
            Worksheets("Graph1").Cells(27, 4) = 1 * Mid(Worksheets("Graph1").Cells(26, 4), xmark + 4, 100) 'y-intercept
            Worksheets("Graph1").Cells(28, 4) = Mid(Worksheets("Graph1").Cells(26, 4), 1, xmark - 1) 'slope (IACF)
    Thanks for anyone willing to help.
    Last edited by rmacia; 12-05-2013 at 02:24 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: VBA Code works with step (f8) not run <ctrl>f8

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-07-2010
    Location
    Madison, WI
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: VBA Code works with step (f8) not run <ctrl>f8

    edited post with code tags. Sorry

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA to IE - Works in step through, not when run
    By bruizer31 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2013, 03:48 PM
  2. [SOLVED] Macro works in step through but not when run
    By bruizer31 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2013, 05:50 PM
  3. [SOLVED] It works when I step through it but it won't run
    By chillihawk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2006, 06:15 PM
  4. My VBA code works in the step though mode but not at full speed
    By Kelly in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-15-2005, 10:06 PM

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