Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

# macro

### #1 laties Posted 16 July 2010 - 09:27 AM

laties

New Member

• Member
• 1 posts
Hi I have this macro and at the end it gives me a popup to inform there is duplication or not
If not it enter the new value
If duplication it gives a popup informing there is a popup and that is where I get stuck
I need help to gee the value that is duplication and move the cursor to that cell in Colum A1 to 100000 whatever the range is, where ever it is found after informing there is duplication
macro
Private Sub Worksheet_Change(ByVal Target As Range)
Dim arrCC() As String
Dim strNewCC As String
Dim rngData As Range
Dim i, j, n As Integer
If Target.Column > 1 Then Exit Sub
With Me
strNewCC = .Cells(Target.Row, 1) & .Cells(Target.Row, 2)
Set rngData = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp).Offset(0, 1))
End With
ReDim arrCC(1 To rngData.Rows.Count)
For i = 1 To UBound(arrCC)
arrCC(i) = rngData.Cells(i, 1) & rngData.Cells(i, 2)
Debug.Print "arrCC(" & i & ") = " & arrCC(i)
Next i
For j = 1 To UBound(arrCC)
If arrCC(j) = strNewCC Then n = n + 1
Next j
If n > 1 Then MsgBox "ID No exsist", vbInformation + vbOKOnly, "Ey-up..."
Here it must go to the cell in colum “A” where the value is that is duplication
End sub
• 0

### Similar Topics

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users