PC Review


Reply
Thread Tools Rate Thread

Comparing Formula Strings after Row has been Inserted

 
 
=?Utf-8?B?RXhjZWxNb25rZXk=?=
Guest
Posts: n/a
 
      7th May 2007
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      7th May 2007
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
>

 
Reply With Quote
 
=?Utf-8?B?RXhjZWxNb25rZXk=?=
Guest
Posts: n/a
 
      7th May 2007
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
> >

 
Reply With Quote
 
Susan
Guest
Posts: n/a
 
      7th May 2007
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 <ExcelMon...@discussions.microsoft.com>
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing Strings Jonathan Wood Microsoft C# .NET 7 27th Jan 2006 03:39 AM
Comparing strings rossum Microsoft C# .NET 4 25th Jun 2005 02:34 AM
Comparing Strings with < Jonathan Rynd Microsoft Excel Worksheet Functions 3 31st Aug 2004 06:54 PM
Comparing strings Dennieku Microsoft C# .NET 5 4th Sep 2003 03:17 AM
Comparing strings Dennieku Microsoft Dot NET 5 4th Sep 2003 03:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:12 AM.