Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a cell range named CNT. Initially a number is manually entered in CNT
for the number of rows to be added at the cursor's position. Let's say that number is 2 (two). As the machine adds rows, I want it to decrease the value of CNT by 1 (one) until the value of CNT equals zero (0). I do not know how to write an Excel macro line to do this. If it were a Lotus 1-2-3 macro, that line would be, {let cnt;cnt-1}. My macro's end result is a circular reference and the value of CNT is 0 (zero) after its first itineration. Below is my macro. Sub Macro1() ' Inserts rows until CNT value equals zero Do Until Range ("CNT") = 0 If Range ("CNT") = 1 Then ActiveCell.Select Selection.EntireRow.Insert Range ("CNT").Formula ="=(CNT)-1" '<-- My incorrect line End If Loop End Sub Thank you very much for your help. -- Rodney Getschman Wisconsin VFW |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reducing the number of digits in a cell | Excel Discussion (Misc queries) | |||
reducing the number of times an IF statement needs to be calculated in embedded IF statements | Excel Discussion (Misc queries) | |||
A reducing number by given dates | Excel Discussion (Misc queries) | |||
A reducing number by given dates | New Users to Excel | |||
how do i create a reducing number that reduces at certain dates | Excel Discussion (Misc queries) |