+ Reply to Thread
Results 1 to 3 of 3

Excel Macro

  1. #1
    phmckeever
    Guest

    Excel Macro

    Two Oracle databases are being run parallel. The data in these databases
    need to be verified as being the same.

    sqlplus code has been developed to generates a text file of differences
    between the data in the databases.

    I am using an excel macro to format the data produced by the sqlplus code.
    The rows that selected have identical numbers in the first column of the
    report. The last piece that I am trying to accomplish is as follows:

    1. Find the two duplicate numbers in the first column of the report,
    2. Select the two duplicate number rows,
    3. Find the cells in the rows that are different, and , finally,
    4. Highlight the different cell values.

    Can up help me with the coding for this?

    phmckeever


  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    If you can sort the file in Excel by the first column of numbers you can then use conditional formatting to highlight the differences as follows:
    1. Highlight the full range of data
    2. Select Format\Conditional Formatting... from the menu
    3. Select "Formula Is" in the first drop down box
    4. Enter the formula =IF($A1=$A2,A1<>A2,FALSE) in the text box to the right
    5. Select your format preference
    6. Click the Add button
    7. For the second condition Select "Formula Is" in the first drop down box
    8. Enter the formula =IF($A65536=$A1,A65536<>A1,FALSE) in the text box to the right
    9. Select your format preference (same one as above probably)
    10. Click OK
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

  3. #3
    phmckeever
    Guest

    Re: Excel Macro

    Excelenator,

    There are highlights in the spreadsheet; but, not the cells I need
    highlighted. I need to find the rows with the same row number; and, then,
    highlight the cells that caused the rows to be selected. In other words, I
    want to highlight the two cells in the duplicate rows that are different.

    Can you rewrite the IF..statement?

    phmckeever


    "Excelenator" wrote:

    >
    > If you can sort the file in Excel by the first column of numbers you can
    > then use conditional formatting to highlight the differences as
    > follows:
    >
    > - Highlight the full range of data
    > - Select Format\Conditional Formatting... from the menu
    > - Select "Formula Is" in the first drop down box
    > - Enter the formula =IF($A1=$A2,A1<>A2,FALSE) in the text box to the
    > right
    > - Select your format preference
    > - Click the Add button
    > - For the second condition Select "Formula Is" in the first drop down
    > box
    > - Enter the formula =IF($A65536=$A1,A65536<>A1,FALSE) in the text box
    > to the right
    > - Select your format preference (same one as above probably)
    > - Click OK
    >
    >
    > --
    > Excelenator
    >
    >
    > ------------------------------------------------------------------------
    > Excelenator's Profile: http://www.excelforum.com/member.php...o&userid=36768
    > View this thread: http://www.excelforum.com/showthread...hreadid=573088
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1