Move text from end of cell to beginning

q1911

New Member
Joined
Apr 10, 2013
Messages
10
Hello-

When I import data from a site into excel, negative percents show up as .1- instead of -.1

Is there any way to have a macro move the - from the end to the start of the cell.

There are other cells in the sheet that have the - in the beginning.

Thanks!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Welcome to the board..

Try highlighting the column of data
Data - Text to Columns
Deliminated - Next
Uncheck all options - Next
Click Advainced
Check "Trailing minus for negative numbers" - OK
Finish
 
Upvote 0
Hi,

I hope The Code Will Help You.
Code:
Sub Check()
For Each Cell In Range("a1:az" & Cells.End(xlDown).Row)
If InStr(1, Cell.Value, "-") > 0 Then
Cell.Value = "-" & Left(Cell.Value, Len(Cell.Value) - 1)
End If
Next
End Sub

ZAX
 
Upvote 0
Welcome to the board..

Try highlighting the column of data
Data - Text to Columns
Deliminated - Next
Uncheck all options - Next
Click Advainced
Check "Trailing minus for negative numbers" - OK
Finish


Thank you. Recorded that as a macro and it worked perfect.

Thanks for the replies!
 
Upvote 0

Forum statistics

Threads
1,203,514
Messages
6,055,840
Members
444,828
Latest member
StaffordStag

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