change format cell of text

amiroo

Board Regular
Joined
Dec 24, 2013
Messages
124
Office Version
  1. 2019
Platform
  1. Windows
hi guys

I want change format of text and put some / in it

for example: (put / after second character)
Excel => Ex/cel
Hello => He/llo


does it possible? Of course without vba
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
You can do it with a formula in another column. For example: =REPLACE(A1,3,0,"/")
 
Upvote 0
You can do it with a formula in another column. For example: =REPLACE(A1,3,0,"/")

thanks dear peter. but I need use format cell because I can't use second column. the only way is using format cell or vba
 
Last edited:
Upvote 0
the only way is using format cell or vba
Then if vba is now allowed, you can try this Worksheet_Change code in a new workbook. To implement ..
1. Right click the sheet name tab and choose "View Code".
2. Copy and Paste the code below into the main right hand pane that opens at step 1.
3. Close the Visual Basic window & test.
4. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm).

Note that the code targets values entered into column A from row 2 down. If this needs to be changed and you are unable to do so yourself, post back with details of the target area.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Dim Changed As Range, c As Range
  Dim s As String
  
  Set Changed = Intersect(Target, Columns("A"), Rows("2:" & Rows.Count))
  If Not Changed Is Nothing Then
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    For Each c In Changed
      s = c.Value
      If Len(s) > 1 Then
        If Mid(s, 3, 1) <> "/" Then
          c.Value = Replace(s, Left(s, 2), Left(s, 2) & "/", 1, 1)
        End If
      End If
    Next c
    Application.EnableEvents = True
    Application.ScreenUpdating = True
  End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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