NEED HELP PLEASE

manilla_r22

New Member
Joined
Oct 13, 2022
Messages
12
Office Version
  1. 2019
Platform
  1. Windows
1665685941524.png

HOW DO I GET THE * TO CHANGE TO (a) in superscript.
Need the parentheses as well.

I tried the replace button, it replaces the whole word as well.

I have multiple large files and trying to find the most efficient method

For example, i want it to look like this

1665686338202.png
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Nevermind. Use this code.

VBA Code:
Sub find_and_replace()

Dim find_value, replace_value As String

find_value = "~*"
replace_value = "(A)"

    Columns("C").Replace What:=find_value, _
                            Replacement:=replace_value, _
                            LookAt:=xlPart, _
                            SearchOrder:=xlByRows, _
                            MatchCase:=False, _
                            SearchFormat:=False, _
                            ReplaceFormat:=False

MsgBox "Done With Replacement!"

End Sub
 
Upvote 0
It will do that also, for range from C2 to C1000

VBA Code:
Sub Superscript_part_value()

Dim ws As Worksheet
Dim rg As Range
Dim st As Long

Set ws = ActiveSheet
Set rg = ws.Range("C2:C1000")

For Each cll In rg

If InStr(cll, "(A)") > 0 Then
st = InStr(cll, "(A)")
cll.Characters(Start:=st, Length:=3).Font.Superscript = True
End If

Next

End Sub
 
Upvote 0
Use this only

VBA Code:
Sub find_and_replace()

Dim find_value, replace_value As String

find_value = "~*"
replace_value = "(A)"

    Columns("C").Replace What:=find_value, _
                            Replacement:=replace_value, _
                            LookAt:=xlPart, _
                            SearchOrder:=xlByRows, _
                            MatchCase:=False, _
                            SearchFormat:=False, _
                            ReplaceFormat:=False


Dim ws As Worksheet
Dim rg As Range
Dim st As Long

Set ws = ActiveSheet
Set rg = ws.Range("C2:C1000")

For Each cll In rg

If InStr(cll, "(a)") > 0 Then
st = InStr(cll, "(a)")
cll.Characters(Start:=st, Length:=3).Font.Superscript = True
End If

Next

MsgBox "Done With Replacement!"

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top