Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49956

Adding a Formula to entire column in table

$
0
0
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

Viewing all articles
Browse latest Browse all 49956

Trending Articles