View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jason Lepack Jason Lepack is offline
external usenet poster
 
Posts: 120
Default 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