Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This should be easy for the gurus out there. I have a snippet of code that needs to contain something similar t below but carry through J34. Is there a way to do this with one line? Range("j15").Formula = "=c15*I15" Range("j16").Formula = "=c16*I16" Range("j17").Formula = "=c17*I17 -- Rich Kniat ----------------------------------------------------------------------- Rich Kniatt's Profile: http://www.excelforum.com/member.php...fo&userid=1909 View this thread: http://www.excelforum.com/showthread.php?threadid=52983 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Rich,
Here's a code that works although there's probably a better solution out there somewhe Sub test() Dim x As Integer x = 15 Start: If x = 35 Then Exit Sub Range("J" & x).Formula = "=C" & x & "*I" & x x = x + 1 GoTo Start End Sub Adjust x to fit your start cell and adjust the If statement to fit one past your ending cell. HTH Don "Rich Kniatt" wrote: This should be easy for the gurus out there. I have a snippet of code that needs to contain something similar to below but carry through J34. Is there a way to do this with one line? Range("j15").Formula = "=c15*I15" Range("j16").Formula = "=c16*I16" Range("j17").Formula = "=c17*I17" -- Rich Kniatt ------------------------------------------------------------------------ Rich Kniatt's Profile: http://www.excelforum.com/member.php...o&userid=19093 View this thread: http://www.excelforum.com/showthread...hreadid=529834 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("j15:J34").Formula = "=c15*I15"
-- Regards, Tom Ogilvy "Rich Kniatt" wrote in message ... This should be easy for the gurus out there. I have a snippet of code that needs to contain something similar to below but carry through J34. Is there a way to do this with one line? Range("j15").Formula = "=c15*I15" Range("j16").Formula = "=c16*I16" Range("j17").Formula = "=c17*I17" -- Rich Kniatt ------------------------------------------------------------------------ Rich Kniatt's Profile: http://www.excelforum.com/member.php...o&userid=19093 View this thread: http://www.excelforum.com/showthread...hreadid=529834 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Tom, it seems the easiest way is not always the most obvious ;) Tom Ogilvy Wrote: Range("j15:J34").Formula = "=c15*I15" -- Regards, Tom Ogilvy "Rich Kniatt" wrote in message ... This should be easy for the gurus out there. I have a snippet of code that needs to contain something similar to below but carry through J34. Is there a way to do this with one line? Range("j15").Formula = "=c15*I15" Range("j16").Formula = "=c16*I16" Range("j17").Formula = "=c17*I17" -- Rich Kniatt ------------------------------------------------------------------------ Rich Kniatt's Profile: http://www.excelforum.com/member.php...o&userid=19093 View this thread: http://www.excelforum.com/showthread...hreadid=529834 -- Rich Kniatt ------------------------------------------------------------------------ Rich Kniatt's Profile: http://www.excelforum.com/member.php...o&userid=19093 View this thread: http://www.excelforum.com/showthread...hreadid=529834 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copied formula produces unexpected copied results | New Users to Excel | |||
How to add formula calling up current workbook when sheet copied | Excel Discussion (Misc queries) | |||
insert copied row on a protected sheet | Excel Discussion (Misc queries) | |||
carrying over a column formula from one sheet to another copied sh | Excel Worksheet Functions | |||
Date formula that adds 7 days to a cell when sheet is copied | Excel Worksheet Functions |