Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

macro


  • Please log in to reply

#1
laties

laties

    New Member

  • Member
  • Pip
  • 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

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP