Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to delete a question mark throughout database
The last answer for my 18,000 record database worked wonders. Now the
problem is that throughout the database, the dataentry person / transcriber inserted the character '?' most anywhere in the cell where they were unsure of what they were transcribing. The format should have been 'lastname, firstname.' Instead throughout I have found 'lastname?, firstname?' What I would like is for a macro to locate those random ?s and ask me if I want it deleted and hit enter to make it go away. Any thoughts? Also, doing a search for the ?s doesn't work since this works as a wildcard. Any help would be greatly appreciated. TJ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to delete a question mark throughout database
TJ
Why do you need code if you are asking each time to delete? Why not just use find and replace. To search for a wildcard * or %, prefix with a tilde ~* or ~? -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England DTHIS www.nickhodge.co.uk "TJ" wrote in message ups.com... The last answer for my 18,000 record database worked wonders. Now the problem is that throughout the database, the dataentry person / transcriber inserted the character '?' most anywhere in the cell where they were unsure of what they were transcribing. The format should have been 'lastname, firstname.' Instead throughout I have found 'lastname?, firstname?' What I would like is for a macro to locate those random ?s and ask me if I want it deleted and hit enter to make it go away. Any thoughts? Also, doing a search for the ?s doesn't work since this works as a wildcard. Any help would be greatly appreciated. TJ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to delete a question mark throughout database
Make a backup of your 18000 record database and then make another copy
and test this out on it. Select the cells that you want to search for the ? in and then run this macro. Sub Macro2() Dim r As Range, x As Integer For Each r In Selection x = InStr(1, r, "?") If x 0 Then If MsgBox(r & vbCrLf & vbCrLf & "Delete This?", vbYesNo) = vbYes Then r = "" End If End If Next r End Sub It shows a message box that asks if you want to delete the value. If you click "Yes" then it empties that cell. Cheers, Jason Lepack TJ wrote: The last answer for my 18,000 record database worked wonders. Now the problem is that throughout the database, the dataentry person / transcriber inserted the character '?' most anywhere in the cell where they were unsure of what they were transcribing. The format should have been 'lastname, firstname.' Instead throughout I have found 'lastname?, firstname?' What I would like is for a macro to locate those random ?s and ask me if I want it deleted and hit enter to make it go away. Any thoughts? Also, doing a search for the ?s doesn't work since this works as a wildcard. Any help would be greatly appreciated. TJ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using the Question Mark With COUNTIF | Excel Worksheet Functions | |||
Delete asterik mark | Excel Discussion (Misc queries) | |||
Question Mark in a box | Excel Discussion (Misc queries) | |||
Mark active row in column A (VB question) | Excel Discussion (Misc queries) | |||
How can I find and mark double entries in a customer database? | Excel Worksheet Functions |