ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to delete a question mark throughout database (https://www.excelbanter.com/excel-programming/379833-how-delete-question-mark-throughout-database.html)

TJ[_4_]

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


Nick Hodge

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



Jason Lepack

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




All times are GMT +1. The time now is 08:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com