VBA - Same formula in the same column but different rows

aaggh2003

New Member
Joined
Jan 9, 2018
Messages
1
Since my last column is not always absolute I use the xlToRight command to get to the correct cell. I am trying to do the same step for row 5-11,14-20 and 23-29.
Currently I have something like this:

Range("C5").End(xlToRight).Formula = Range("C5") - Range("C5").End(xlToRight).Offset(0, -2)
Range("C6").End(xlToRight).Formula = Range("C6") - Range("C6").End(xlToRight).Offset(0, -2)
Range("C7").End(xlToRight).Formula = Range("C7") - Range("C7").End(xlToRight).Offset(0, -2)
Range("C8").End(xlToRight).Formula = Range("C8") - Range("C8").End(xlToRight).Offset(0, -2)

Was trying to use FormulaR1C1 but I have the xlToRight command.

Appreciate any help!
 

Forum statistics

Threads
1,082,442
Messages
5,365,549
Members
400,837
Latest member
ELMST616

Some videos you may like

This Week's Hot Topics

Top