Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Mike S" wrote in message For n = 34 To 81 Cells(n, 4).Formula = "=IF(D31," & Cells(n, 2).Address & " /" & Cells(31, 4).Address & ", 0)" Next FWIW this would do the same Cells(34, 4).Resize(81 - 34 + 1).Formula = "=IF($D$31," & Cells(34, 2).Address(0, 0) & "/ $D$31, 0)" or this addr0 = Cells(34, 4).Resize(81 - 34 + 1).Address ' could be absolute or relative addr1 = Cells(31, 4).Address ' absolute addr2 = Cells(34, 2).Address(False, False) ' R & C both relative Range(addr0).Formula = "=IF(" & addr1 & "," & addr2 & "/" & addr1 & ",0)" or Range(Cells(34, 4), Cells(81, 4)).Formula = etc IOW, if a formula can be "filled" it can be written in one go with the formula of the first cell Peter T |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamically populate a Date pulldown menu? | Excel Discussion (Misc queries) | |||
Dynamically declare and populate variables | Excel Programming | |||
Dynamically populate spreadsheets in a workbook | Excel Programming | |||
Dynamically setting Dimensions in a VBA loop | Excel Programming | |||
Populate workbook dynamically?? | Excel Programming |