Raaj Chauhan
New Member
- Joined
- Aug 1, 2015
- Messages
- 9
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
<tbody style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">
</tbody></body>
<tbody style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">
</tbody>
0down votefavorite | I am currently using this macro to prevent users from entering similar entries within a spreadsheet. This is working fine in a single column. But how can I add similar in multiple columns (like Column A, D and F). Each column as to allow only unique records only. Please help me out |
<tbody style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">
</tbody>
down votefavorite | I am currently using this macro to prevent users from entering similar entries within a spreadsheet. This is working fine in a single column. But how can I add similar in multiple columns (like Column A, D and F). Each column as to allow only unique records only. Please help me out Private Sub Worksheet_Change(ByVal Target As Range) With Target If .Column <> 1 Or .Cells.Count > 1 Then Exit Sub If WorksheetFunction.CountIf(Columns(.Column), .Value) > 1 Then Application.DisplayAlerts = False .ClearContents Application.DisplayAlerts = True MsgBox "Aadhar no. already exists!" End If End With End Sub |
<tbody style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">
</tbody>