LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Search for formulas in cells and apply to new record--no data form.

Hi there,
Code such as the one below copies formulas in the last cells of columns
3 and 10 down to the new rows when inserted. However, I need to allow
the user to overwrite the formula in column 3 with any text value. If
the user overwrites this formula on the last row, and then manually
goes to a new row, then the code below doesn't work (it simply copies
what value is in the above cell).

Is there a way for code search upward in columns 3 and 10 until it
reaches the last cells with formulas, and apply the formulas to the new
cells in columns 3 and 10 on the new row?

Or, is there a way to store the formulas:

=IF(A21<"",B21,"") in column 3
=IF(B21<0,IF(C21<B21,A21&", "&LEFT(C21,2),A21&", "&LEFT(B21,1)),"")
in column 10

behind the worksheet?

'This code carries formulas down from the previous row but does not
'take into consideration if the formula has been overwritten in the
row above.

If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub
On Error GoTo CleanUp:
With Target
If .Value < "" Then
Application.EnableEvents = False
.Offset(0, 3).FormulaR1C1 = "=RC[-1]=R2C3"
.Offset(0, 10).FormulaR1C1 = "=RC[-1]=R2C10"
End If
End With
CleanUp:
Application.EnableEvents = True

Thanks a lot!
Eric

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search a range to find cells containing formulas tanktata[_9_] Excel Programming 5 July 7th 06 04:41 PM
Can Excel recognize when data is entered and apply formulas? cwool4512 Excel Worksheet Functions 2 July 7th 05 07:58 PM
how do I search for any cell containing data and apply conditiona. Dawn Excel Discussion (Misc queries) 1 April 20th 05 10:59 AM
Go to record found by Criteria in Data Form Paul Simon[_3_] Excel Programming 0 December 18th 03 03:31 PM
Current row/record shown when opening data/form buczacz Excel Programming 8 October 22nd 03 04:31 AM


All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"