Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Comparing Formula Strings after Row has been Inserted

Is there a way in VBA to compare two formula strings should be the same aside
from the fact that rows have been insterted. For example. Lets say

OriginalString = SUM(B1:B4)*B6+B8

Now lets say I know that a Row was inserted at Row 1:
RevisedString = SUM(B2:B5)*B7+B9

Now assume these two formulas return the same value. I want to be able to
write a function which does the following:

CompareStrings (OriginalString, RevisedString).

I only want to test the formula string:

SUM(B1:B4)*B6+B8 = SUM(B2:B5)*B7+B9

I need to adjust B9 in the second term to reflect that it is really B8 + 1
row. I need a formula parser that subtracts a row value from all rows
greater than 8+1 in the second string.

Any ideas

Thanks
EM

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Comparing Formula Strings after Row has been Inserted

could you provide an example of when you would need to make such a comparison?

"ExcelMonkey" wrote:

Is there a way in VBA to compare two formula strings should be the same aside
from the fact that rows have been insterted. For example. Lets say

OriginalString = SUM(B1:B4)*B6+B8

Now lets say I know that a Row was inserted at Row 1:
RevisedString = SUM(B2:B5)*B7+B9

Now assume these two formulas return the same value. I want to be able to
write a function which does the following:

CompareStrings (OriginalString, RevisedString).

I only want to test the formula string:

SUM(B1:B4)*B6+B8 = SUM(B2:B5)*B7+B9

I need to adjust B9 in the second term to reflect that it is really B8 + 1
row. I need a formula parser that subtracts a row value from all rows
greater than 8+1 in the second string.

Any ideas

Thanks
EM

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Comparing Formula Strings after Row has been Inserted

I am putting together a file compare routine with the aim of incorporating
logic to account for inserted rows/columns. First step is assessing if
anyting has been inserted. Second step is to compare the two sets of formula
strings. Most of the file compare logic I have seen does not account for
inserted rows/columns.

Thanks

EM

"JLGWhiz" wrote:

could you provide an example of when you would need to make such a comparison?

"ExcelMonkey" wrote:

Is there a way in VBA to compare two formula strings should be the same aside
from the fact that rows have been insterted. For example. Lets say

OriginalString = SUM(B1:B4)*B6+B8

Now lets say I know that a Row was inserted at Row 1:
RevisedString = SUM(B2:B5)*B7+B9

Now assume these two formulas return the same value. I want to be able to
write a function which does the following:

CompareStrings (OriginalString, RevisedString).

I only want to test the formula string:

SUM(B1:B4)*B6+B8 = SUM(B2:B5)*B7+B9

I need to adjust B9 in the second term to reflect that it is really B8 + 1
row. I need a formula parser that subtracts a row value from all rows
greater than 8+1 in the second string.

Any ideas

Thanks
EM

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Comparing Formula Strings after Row has been Inserted

em -
to see if anything's been inserted, have an auto_open sub that counts
the rows BEFORE anything is done and assign it to a variable. then
you can use that variable to check later if anything's been added.

if you need to check it for if somebody ELSE inserted a row, you could
have a hidden spreadsheet in which you manually enter the # of rows
used at the end of your session, and then the macro compares the
current number of rows to the stored number of rows.

can do the same thing for columns.

just ideas

:)
susan


On May 7, 3:01 pm, ExcelMonkey
wrote:
I am putting together a file compare routine with the aim of incorporating
logic to account for inserted rows/columns. First step is assessing if
anyting has been inserted. Second step is to compare the two sets of formula
strings. Most of the file compare logic I have seen does not account for
inserted rows/columns.

Thanks

EM



"JLGWhiz" wrote:
could you provide an example of when you would need to make such a comparison?


"ExcelMonkey" wrote:


Is there a way in VBA to compare two formula strings should be the same aside
from the fact that rows have been insterted. For example. Lets say


OriginalString = SUM(B1:B4)*B6+B8


Now lets say I know that a Row was inserted at Row 1:
RevisedString = SUM(B2:B5)*B7+B9


Now assume these two formulas return the same value. I want to be able to
write a function which does the following:


CompareStrings (OriginalString, RevisedString).


I only want to test the formula string:


SUM(B1:B4)*B6+B8 = SUM(B2:B5)*B7+B9


I need to adjust B9 in the second term to reflect that it is really B8 + 1
row. I need a formula parser that subtracts a row value from all rows
greater than 8+1 in the second string.


Any ideas


Thanks
EM- Hide quoted text -


- Show quoted text -



Reply
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
Comparing text strings Comparing columns with text Excel Worksheet Functions 5 November 28th 09 07:43 PM
problem with comparing strings in VBA [email protected] Excel Discussion (Misc queries) 2 June 25th 07 11:16 PM
Comparing text strings in cells Andy Excel Discussion (Misc queries) 0 January 11th 06 10:38 AM
Comparing text strings in cells Andy Excel Discussion (Misc queries) 0 December 7th 05 04:17 PM
Comparing slightly different strings theDude[_18_] Excel Programming 0 July 30th 05 12:55 AM


All times are GMT +1. The time now is 12:49 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"