ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Registry compare (https://www.excelbanter.com/excel-programming/390395-registry-compare.html)

Lillian Lian

Registry compare
 
I have two registry key which is test.reg and test-A.reg, the test.reg is
before I install script on the machine, the test-A.reg is after I install
script on the machine, so how can I write the VB script to compare both
test.reg and rest-A.reg, right now on the sheet1 I have test.reg from column
A to B, test-A.reg from column D to E, how can I write the macro, dump the
different in sheet2.


Thank you for the help

Lillian

Dave Peterson

Registry compare
 
You may find that excel isn't the tool to do this kind of thing.

But you may find that MSWord's tools|compare and merge documents will work ok.



Lillian Lian wrote:

I have two registry key which is test.reg and test-A.reg, the test.reg is
before I install script on the machine, the test-A.reg is after I install
script on the machine, so how can I write the VB script to compare both
test.reg and rest-A.reg, right now on the sheet1 I have test.reg from column
A to B, test-A.reg from column D to E, how can I write the macro, dump the
different in sheet2.

Thank you for the help

Lillian


--

Dave Peterson

Lillian Lian

Registry compare
 
you means Vlookup? but I still can not fingure how to do that, need help

thank you


"Dave Peterson" wrote:

You may find that excel isn't the tool to do this kind of thing.

But you may find that MSWord's tools|compare and merge documents will work ok.



Lillian Lian wrote:

I have two registry key which is test.reg and test-A.reg, the test.reg is
before I install script on the machine, the test-A.reg is after I install
script on the machine, so how can I write the VB script to compare both
test.reg and rest-A.reg, right now on the sheet1 I have test.reg from column
A to B, test-A.reg from column D to E, how can I write the macro, dump the
different in sheet2.

Thank you for the help

Lillian


--

Dave Peterson


ct60

Registry compare
 
Hi Lillian -

I think I understand the question. It is confusing because when you say
registry key I think you mean the registry in the computer. In any case, you
are basically comparing cols A and D as well as col B and E on Sheet1 and
dumping out the difference onto Sheet2. This code should work. You will
also have to fill in the number of rows you need to check. You can guess the
largest possible number of rows because blank rows will compare as the same.
Try this:

Sub ck_It()
Dim ws As Worksheet
Dim report_ws As Worksheet
Dim reportPtr As Integer
Dim i As Integer

Set ws = ThisWorkbook.Sheets("Sheet1")
Set report_ws = ThisWorkbook.Sheets("Sheet2")

reportPtr = 1

' Assume there are 100 rows to compare and that we
' are comparing col A to col D and col B to col E

With ws
For i = 1 To 100 ' or however many rows you need to check
If .Range("A" & i) < .Range("D" & i) Then
report_ws.Range("A" & reportPtr) = "Cols 'A' and 'D' not
equal on row " & i
reportPtr = reportPtr + 1
End If

If .Range("B" & i) < .Range("E" & i) Then
report_ws.Range("A" & reportPtr) = "Cols 'B' and 'E' not
equal on row " & i
reportPtr = reportPtr + 1
End If
Next
End With
End Sub

Hope that helps

Chris (ct60)


"Lillian Lian" wrote:

I have two registry key which is test.reg and test-A.reg, the test.reg is
before I install script on the machine, the test-A.reg is after I install
script on the machine, so how can I write the VB script to compare both
test.reg and rest-A.reg, right now on the sheet1 I have test.reg from column
A to B, test-A.reg from column D to E, how can I write the macro, dump the
different in sheet2.


Thank you for the help

Lillian


Dave Peterson

Registry compare
 
Nope. I'm saying don't use excel at all.

I'm saying try using the MSWord (the word processor program in the Office
Suite).

Or try download.com and look for a free text comparison program.



Lillian Lian wrote:

you means Vlookup? but I still can not fingure how to do that, need help

thank you

"Dave Peterson" wrote:

You may find that excel isn't the tool to do this kind of thing.

But you may find that MSWord's tools|compare and merge documents will work ok.



Lillian Lian wrote:

I have two registry key which is test.reg and test-A.reg, the test.reg is
before I install script on the machine, the test-A.reg is after I install
script on the machine, so how can I write the VB script to compare both
test.reg and rest-A.reg, right now on the sheet1 I have test.reg from column
A to B, test-A.reg from column D to E, how can I write the macro, dump the
different in sheet2.

Thank you for the help

Lillian


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 04:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com