View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
davidm davidm is offline
external usenet poster
 
Posts: 1
Default need help determining a row number


Mike,

Tom was right. To cover both numeric and alphanumeric values, the
following modification is needed, making code all-purpose.

Sub FindRowChanges()
Dim v
Dim u

'populate range with 123abc
Range("a1:a100") = "123abc"
Range("a1:a100").Value = Range("a1:a100").Value

'create 1st variant array
v = Range("a1:a100").Value

'effect changes to a5 and a10
Range("a5") = 500
Range("a10") = 800

'After changes:
'create 2nd variant array
u = Range("a1:a100").Value

'check differences
For i = 1 To Application.CountA([a:a])
If Not v(i, 1) Like u(i, 1) Then
k = k & "Row " & i & ":"
End If
Next

MsgBox k 'lists all rows wuth changes

End Sub


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=484491