Results 1 to 2 of 2

Sum ActiveCell Value with Formula

Threaded View

Fjcosta Sum ActiveCell Value with... 01-07-2015, 06:18 PM
Richard Buttrey Re: Sum ActiveCell Value with... 01-07-2015, 06:21 PM
  1. #1
    Registered User
    Join Date
    03-17-2014
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    16

    Sum ActiveCell Value with Formula

    Hello there,

    I'm trying to sum the value in a cell with a value from a formula; i've tried everything as i can imagine, with no results.

    Here's the code:

    Sub Macro2()
    Dim Cell As Range
    Dim Myval As Variant
    Myval = ActiveCell.Value
    Input1= "=+SUMIFS(Values1,Mech1,R[0]c2,Data_Limites,R2C)"
    Input2 = "=+COUNTIFS(Values2,R[-1]C2,DR,R2C)"
    Input3 = "=+COUNTIFS(Values2,R[-2]C2,DT,R2C)"
    
    
    For Each Cell In Selection
    If Range("C" & Cell.Row).Text = "Data1" Then
    Cell.Select
    If ActiveCell.Value = "" Then
    Cell.FormulaR1C1 = Input1
    End If
    End If
    If Range("C" & Cell.Row).Text = "Data2" Then
    Cell.Select
    If ActiveCell.Value = "" Then
    Cell.Value = Input2
    Else
    Cell.Value = Myval + Input
    End If
    End If
    If Range("c" & Cell.Row).Text = "Data3" Then
    Cell.Select
    ActiveCell.FormulaR1C1 = Input3
    End If
        Next
        
    End Sub
    Can you help me in this one?

    Thanks in advace
    Last edited by Fjcosta; 01-07-2015 at 06:27 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Selecting Activecell and cell next to the Activecell
    By Raghukumarn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-31-2013, 06:32 AM
  2. [SOLVED] Activecell.formula vba
    By DeNam in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-31-2013, 06:46 AM
  3. Help with ActiveCell.Formula
    By excelrcb3 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-13-2012, 02:40 PM
  4. Output contents of Activecell when Activecell may be string or numeric.
    By jfriddle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2012, 12:27 PM
  5. Using ?ActiveCell.Formula
    By papastyle3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2008, 03:56 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