I need to search through a group of cells. Some have an asterisk in them… 53*. I need to delete the asterisk and keep the value in the same cell, I just need the 53 not the 53*. How can I code this in vba? Thanks for the help.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Take out the asterisk (*) in a cell (Excel xp/win 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Take out the asterisk (*) in a cell (Excel xp/win 2000)
- This topic has 19 replies, 8 voices, and was last updated 22 years, 6 months ago.
Viewing 2 reply threadsAuthorReplies-
WSJohnBF
AskWoody Lounger -
H. Legare Coleman
AskWoody PlusMarch 5, 2002 at 1:30 am #574249John told you how to do this using Find/Replace. If you really need to do it using VBA, the following will remove the first Asterick in all the cells in the current selection. If there can be more than one astherick, or you need some other range that the current selection, it will need to be modified.
Dim oCell As Range Dim iPos As Integer For Each oCell In Selection iPos = InStr(oCell.Value, "*") If iPos > 0 Then oCell.Value = Left(oCell.Value, iPos - 1) & Right(oCell.Value, Len(oCell.Value) - iPos) End If Next oCell
-
WSjha900
AskWoody LoungerDecember 9, 2002 at 8:02 pm #637416is it possible to put this in a formula in excel? I need to check if another cell has a number with an asterisk at the end. i need to change the asterisk to a superior plus sign and leave the number in. in other words, if it is 500* i need to change it to 500+. thanks
also, in another instance i need to see if a + sign is at the end of a cell’s contents i need to put it in the outside of the parens in another cell. so if A10 has 400+ in it, i need to make b10 (400)+. thank you for the help
-
WSsdckapr
AskWoody LoungerDecember 9, 2002 at 8:01 pm #637419There is no way with a formula to change the contents of a cell to something else. If A1 = 500* and you want B1 to be 500+ then this type of formula in B1 will work:
=IF(RIGHT(A1,1)=”*”,LEFT(A1,LEN(A1)-1)&”+”)
If you want A1 to change from 500* to 500+ then you need a macro or find/replace [find: ~*/replace:+]
Steve
-
WSjha900
AskWoody LoungerDecember 9, 2002 at 8:55 pm #637427 -
macropod
AskWoody_MVPDecember 9, 2002 at 9:32 pm #637437Hi jha,
I don’t know what a “superior plus” is, but if you type one into a cell, say A1, and put =code(A1) into another cell, that will return the character’s value. As for changing the asterisk to a +, try:
=SUBSTITUTE(A1,”*”,”+”)
This will replace every “*” in a cell with “+”. If you want to replace only the first asterisk, use:
=SUBSTITUTE(A1,”*”,”+”,1)
or, to replace the second asterisk, use:
=SUBSTITUTE(A1,”*”,”+”,2)
and so on.To replace the asterisk with your “superior plus”, just change the “+” to CHAR(#), where # is the number returned by the CODE(A1) formula referred to earlier. Note too that the “*” and “+” arguments in the SUBSTITUTE formula can be more than one character long, and do not need to be the same length. For example you could have:
=SUBSTITUTE(A1,”*”,CHAR(33)&”+”,1)Cheers
Cheers,
Paul Edstein
[Fmr MS MVP - Word] -
WSWebGenii
AskWoody Lounger -
macropod
AskWoody_MVP -
WSAndrew Cronnolly
AskWoody Lounger -
WSjha900
AskWoody Lounger -
WSsdckapr
AskWoody LoungerDecember 11, 2002 at 7:23 pm #637914If you are superscripting the Plus, the character is still the plus, it is just sperscripted. Some fonts have “superscripted characters” that are different , eg Code 178 is a “superscripted 2” and is NOT a 2 =Code50.
I do NOT think that a “Supercripted +” is a character in a normal font, so it must be superscripted via a macro or manually. It can NOT be done in a formula!
Steve -
macropod
AskWoody_MVPDecember 11, 2002 at 8:23 pm #637926I’m assuming then that when you say ‘superior’ you’re referring to what everyone else here calls superscript. In that case, you do indeed need a macro and one like Steve posted should do fine.
Be aware though that, because you can’t superscript a character returned by a formula, the only way to superscript an individual character in such a cell is by converting its contents into an alpha-numeric string. That means that by running the superscripting macro you lose the formula, if the cell has one.
Cheers
Cheers,
Paul Edstein
[Fmr MS MVP - Word] -
WSJohnBF
AskWoody LoungerDecember 9, 2002 at 10:18 pm #637450See if the attachment to post 144039 is of use, and note the underlying VBA method to produce unicode, courtesy of Rory. OTOH, it may be useless
.
-
WSsdckapr
AskWoody LoungerDecember 9, 2002 at 11:04 pm #637458I assume by “superior +” you mean a “superscripted Plus sign” I know of know character set that has a super+.
If you just have the “500*” entered and you want to change the asterisk to a superscripted + try this code. Highlight the cells to check and it will change all the ending Asterisks to superscripted +.
Steve
Sub AsteriskToSuperiorPlus() Dim rCell As Range Dim iLen As Integer For Each rCell In Selection If Right(rCell.Value, 1) = "*" Then iLen = Len(rCell.Value) rCell.Value = Left(rCell.Value, iLen - 1) & "+" rCell.Characters(Start:=iLen, Length:=1).Font.Superscript = True End If Next End Sub
-
-
-
-
WSJohnBF
AskWoody LoungerMarch 5, 2002 at 7:56 pm #574407Legare correctly pointed out that I didn’t answer your request for VBA code. In addition to his code here’s a couple more VBA bits, both require that you select the cells to be operated on before running the macro:
Sub RemoveAllAsterisks()
On Error Resume Next
Selection.Replace What:=”~*”, Replacement:=””
End SubThis one removes only trailing (last in cell contents) asterisks.
Sub RemoveTrailingAsterisk()
Dim rngCell As Range
Dim strCellVal As String
Dim intVLen As Integer
For Each rngCell In Selection
strCellVal = rngCell.Value
If InStr(strCellVal, “*”) > 0 Then
intVLen = Len(strCellVal)
If Right(strCellVal, 1) = “*” Then
rngCell.Value = Left(strCellVal, intVLen – 1)
End If
End If
Next rngCell
End SubWSfburg
AskWoody LoungerMarch 6, 2002 at 3:04 pm #574704John,
Since my Excel VBA isn’t all that great, let me ask the following question with respect to the following part of your code
If InStr(strCellVal, "*") > 0 Then intVLen = Len(strCellVal) If Right(strCellVal, 1) = "*" Then rngCell.Value = Left(strCellVal, intVLen - 1) End If End If
If the 1st If is not successful (ie, no asterisks in cell), next 5 statements skipped. No problem. If there is one or more *’s in the cell, there may be one in the last position (regardless of whether there are any prior to that in the cell). So why is the first If-test even needed and the following intVLen=…? Why not just do the If Right test since that would have to be done if there’s an * anywhere with the code as it exists? Then the rngCell.Value statement could just be:
rngCell.Value = Left(strCellVal, Len(strCellVal) – 1)Thanks for any insights.
Fred
-
WSJohnBF
AskWoody Lounger
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
10 hours, 54 minutes ago -
June KB5060842 update broke DHCP server service
by
Alex5723
9 hours, 26 minutes ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
13 hours, 28 minutes ago -
Excessive security alerts
by
WSSebastian42
9 hours, 9 minutes ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
22 hours, 57 minutes ago -
Ben’s excellent adventure with Linux
by
Ben Myers
21 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
10 hours, 5 minutes ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
20 hours ago -
OS news from WWDC 2025
by
Will Fastie
1 day ago -
Need help with graphics…
by
WSBatBytes
1 hour, 15 minutes ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
1 day, 14 hours ago -
Totally remove or disable BitLocker
by
CWBillow
13 hours, 32 minutes ago -
Windows 10 gets 6 years of ESU?
by
n0ads
16 hours, 47 minutes ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
2 days, 1 hour ago -
Search Forums only bring up my posts?
by
Deo
4 hours, 55 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
2 days, 12 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
2 days, 5 hours ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
2 days, 13 hours ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
2 days, 23 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
3 days ago -
Disengage Bitlocker
by
CWBillow
2 days, 14 hours ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
3 days, 2 hours ago -
New Win 11 Pro Geekom Setup questions
by
Deo
4 hours, 49 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
3 days, 9 hours ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
3 days, 10 hours ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
3 days, 13 hours ago -
New PC transfer program recommendations?
by
DaveBoston
1 day, 18 hours ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
3 days, 18 hours ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
3 days, 18 hours ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
3 days, 6 hours ago
Recent blog posts
- Ben’s excellent adventure with Linux
- Seconds are back in Windows 10!
- WebBrowserPassView — Take inventory of your stored passwords
- OS news from WWDC 2025
- Best tools for upgrading a Windows 10 to an 11
- Master patch listing for June 10, 2025
- 24H2 may not be offered June updates
- June 2025 updates are out
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.