How to Move Minus Sign from Right to Left/Back to Front in Excel?


Powerful spreadsheet software like Excel provides a variety of formatting choices to improve the way your data is presented. On occasion, you might need to move a negative sign inside a cell in order to obtain the correct formatting. This video will walk you through the essential procedures whether you want to relocate the minus sign to the left of a number or bring it back to the front. By the time you finish this article, you will be able to use minus signs in Excel to accomplish the desired formatting. Let's start now!

Move Minus Sign from Right to Left/Back to Front

Here, we will first create a VBA module and then run it to complete the task. So let us see a simple process to know how you can move the minus sign from right to left or back to front in Excel.

Step 1

Consider an Excel sheet where the data in the sheet is similar to the below image.

First, right-click on the sheet name and select View code to open the VBA application.

Right Click > View Code.

Step 2

Then click on Insert and select Module, then copy the below code into the text box.

Insert > Module > Copy.

Code

Sub FixTrailingNumbers()
   Dim xRg As Range
   Dim xCol As Range
   Dim xTxt As String
   On Error Resume Next
   xTxt = ActiveWindow.RangeSelection.Address
   Set xRg = Application.InputBox("Select a range", "Move Minus Sign", xTxt, , , , , 8)
   If xRg Is Nothing Then Exit Sub
   For Each xCol In xRg.Columns
      xCol.TextToColumns Destination:=xCol, TrailingMinusNumbers:=True
   Next
End Sub

Step 3

Then click F5 to run the module. Then select the range of cells and click OK.

F5 > Select Cells > Ok.

This is how you can move the minus sign from right to left in Excel.

Conclusion

In this tutorial, we have used a simple process to learn how you can move the minus sign from right to left or back to front in Excel to highlight a particular set of data.

Updated on: 24-Aug-2023

794 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements