View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don G Don G is offline
external usenet poster
 
Posts: 13
Default Using VBA to Insert Formula in Copied Sheet

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