Assigning Variable Range
nrow = 8, so rrow = 5
but the below is not working -- What's wrong? ..... *** code ** nrow = Range("A65536").End(xlUp).Row + 1 rrow = nrow - 3 rrow = CInt(rrow) Range("A" & nrow).Select ActiveCell.FormulaR1C1 = "=SUM(R[-rrow]C:R[-1]C)" <<< PROBLEM Range("A2").EntireRow.Delete Range("A1").Select |
Assigning Variable Range
never mind, just tried the below, which worked..
ActiveCell.FormulaR1C1 = "=SUM(R[-" & rrow & "]C:R[-1]C)" "JMay" wrote: nrow = 8, so rrow = 5 but the below is not working -- What's wrong? .... *** code ** nrow = Range("A65536").End(xlUp).Row + 1 rrow = nrow - 3 rrow = CInt(rrow) Range("A" & nrow).Select ActiveCell.FormulaR1C1 = "=SUM(R[-rrow]C:R[-1]C)" <<< PROBLEM Range("A2").EntireRow.Delete Range("A1").Select |
All times are GMT +1. The time now is 12:43 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com