Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy formula using vba based on row count
Hi all,
I have a spreadsheet that number of elements in Col A to Col D will change (they have some # of items). e.g. Row 1 is the header Row 2 contain the descriptions. Row 3 to whatever are the values. Cell(E3).value = formula based on value in A3.. D3 Cell(E4).value = formula based on value in A4.. D4 How do I use VBA to copy the formula to the Col E based on number of items in ColA? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy formula using vba based on row count
iLastRow = Cells(Rows.Count,"A").End(xlUp).Row For i = 3 To iLastRow Cells(i,"E").Formula = "=SUM(A" & i & ":D" & i & ")" Next i The formula will change to your formula. -- HTH RP (remove nothere from the email address if mailing direct) "Jeff" wrote in message ... Hi all, I have a spreadsheet that number of elements in Col A to Col D will change (they have some # of items). e.g. Row 1 is the header Row 2 contain the descriptions. Row 3 to whatever are the values. Cell(E3).value = formula based on value in A3.. D3 Cell(E4).value = formula based on value in A4.. D4 How do I use VBA to copy the formula to the Col E based on number of items in ColA? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula to count based on multiple criteria fields w/duplicates | Excel Worksheet Functions | |||
need formula to count non-zero items in an array based on a vlooku | Excel Worksheet Functions | |||
can i copy any data which is based on formula | Excel Discussion (Misc queries) | |||
Copy data based on a count... | Excel Worksheet Functions | |||
formula to count based on data in two different cells/columns | Excel Discussion (Misc queries) |