Results 1 to 4 of 4

calculating formula only on active rows

Threaded View

  1. #1
    Registered User
    Join Date
    08-11-2009
    Location
    Tennessee
    MS-Off Ver
    Excel 2003
    Posts
    2

    calculating formula only on active rows

    This site has been very helpful in my programming questions so far, but I couldn't find this one on a thread yet.

    I have 3 columns of information, (A) study ID (B) effect size (C) inverse variance. The rows are pasted from other worksheets where other calculations are made. They are automatically pasted into the next empty row.

    After all previous calculations have been made, I need to do some more on this page. I created the code below (well, I recorded it), but it is only for the first row. I can't just paste the formula to every row because then they will not appear as blank rows for the other macros. I want the code to automatically be calculated for every row that has numbers. Thanks so much.


    Sub CI_calculation()
    '
    ' CI_calculation Macro
    '
    
    '
        ActiveSheet.Shapes("Button 7").Select
        Selection.Characters.Text = "CI"
        With Selection.Characters(Start:=1, Length:=2).Font
            .Name = "Arial"
            .FontStyle = "Regular"
            .Size = 10
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
        End With
        Range("D7").Select
        ActiveCell.FormulaR1C1 = "=SQRT(1/RC[-1])"
        Range("E7").Select
        ActiveCell.FormulaR1C1 = "=RC[-3]-1.96*RC[-1]"
        Range("F7").Select
        ActiveCell.FormulaR1C1 = "=1+1.96*RC[-2]"
        Range("G8").Select
    End Sub
    Last edited by bowles; 08-11-2009 at 04:40 PM.

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