+ Reply to Thread
Results 1 to 2 of 2

Adding a Formula to entire column in table

  1. #1
    Registered User
    Join Date
    02-14-2013
    Location
    Wisconsin, USA
    MS-Off Ver
    Excel 2010
    Posts
    55

    Adding a Formula to entire column in table

    I am trying to add a formula to a defined column in a a table. I get a method range of object error. I previously used the .value and a for loop to enter the forumlas into each cell but I would like to use a different approach. It's basically looking at the compelted column to see if the check box is checked. Here's my code.

    Set ntidRange = Application.Range(tn & "[NTID]")
    Set dtRange = Application.Range(tn & "[Date]")

    Range(ntidRange).formula = "=IF([@COMPLETED]=TRUE,Login!K2,"""")"
    Range(dtRange).formula = "=IF([@COMPLETED]=TRUE,Now(),"""")"

    'For Each c In ntidRange.Cells
    'c.formula = "=IF([@COMPLETED]=TRUE,Login!K2,"""")"
    'c.Offset(0, 1).formula = "=IF([@COMPLETED]=TRUE,Now(),"""")"

    'Next

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Adding a Formula to entire column in table

    You have Range objects so you may use them directly:
    Please Login or Register  to view this content.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

+ 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] adding percentage to entire column
    By Shooter66 in forum Excel General
    Replies: 4
    Last Post: 06-11-2012, 09:23 AM
  2. Adding an entire column
    By Cmorgan in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 09-10-2011, 02:10 PM
  3. Adding same value to entire column?
    By shieldsty in forum Excel General
    Replies: 2
    Last Post: 09-15-2008, 04:55 AM
  4. Adding to an entire column?
    By FoxTrot in forum Excel General
    Replies: 2
    Last Post: 10-31-2007, 06:05 PM
  5. Adding formula to Entire Column
    By mwgr5 in forum Excel General
    Replies: 1
    Last Post: 07-03-2007, 10:58 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