how to input formula into selective cells in column ??

C

colwyn

s/s is 325501 rows deep and this consists of over 30000 ranges of data.

There are formulas at the head of each range in columns K and I.

Running down column L is the formula: =K3-I3

The problem is: This last formula runs all down column L and I canno
delete the cells which dont produce a value.

The need is for the formula to only appear by the side of the formula
in columns K and I.

If anyone can supply code to run, or other help, I would be mos
grateful.
Big thanks.
Colwyn
 
S

Simon Lloyd

Colwyn, why not attach a workbook where we can help you with tha
directly

Attatchments.

To upload a workbook, click reply then add your few words, scroll dow
past the submit button and you will see the Manage Attatchments button
this is where you get to add files for upload, if you have any troubl
please use this link or the one at the bottom of th
any page

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
J

Joel

LastRow = Range("K" & Rows.count).End(xlup).row
New = LastRow + 1
Range("L" & NewRow & ":L" & Rows.count).Clearcontents
 
S

Simon Lloyd

Well considering your workbook has absolutely no code in it i assume yo
have entered the formula manually, so put this in L2 =IF(K2="","",K2-I2
and copy down
colwyn;192379 said:
Simon Lloyd thanks
I'm enclosing attachment to illustrate what my problem is
Big thanks
Colwyn

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
S

Simon Lloyd

Simon said:
Well considering your workbook has absolutely no code in it i assume yo
have entered the formula manually, so put this in L2 =IF(K2="","",K2-I2
and copy down!If you really want a coded version this is crude but does the job, it
based on column I having a value

Code
-------------------
Sub formula(
Dim Rng As Range, MyCell As Rang
Set Rng = Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row
For Each MyCell In Rn
If MyCell.Offset(0, 8) <> "" The
MyCell.Offset(0, 11).Value = "=IF(K" & MyCell.Row & "=" & Chr(34) & Chr(34)
& "," & Chr(34) & Chr(34) & ",K" & MyCell.Row & "-I" & MyCell.Row & ")
End I
Next MyCel
End Su
-------------------

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
C

colwyn

Simon Lloyd thanks. I did have your formula in (=IF(K2="","",K2-I2)) bu
the point is the formula remains in all cells afterwards. This cause
s/s to run slow so I need to erase those which dont produce value.

The code works perfectly and I shall use that instead of a formula.
Big thanks.
Colwyn
 
S

Simon Lloyd

*Saying thanks.*

* If you have found my tip helpful then please click on th
animated \\"Say Thanks\\" button to the top right of my post to registe
your appreciation
Thanks for taking the time to mark this thread solved!

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top