Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am importing numbers that has the minus sign to the right of the number. I
need a macro that can move the minus sign to the right of the number. I used to have one but must have copied in incorrectly. What I has so far is.. Sub move_minus_left() Dim currentcell As Object For Each currentcell In Selection If Right (currentcell.Value, 1)="-" Then currentcell.formula="-"&left. I really really need help with this as soon as possible. Thank you Very Much! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This macro converts text with a minus at the end to a number
(I think it's from Bill Manville) Sub FixNeg() Dim C As Range For Each C In ActiveSheet.UsedRange.SpecialCells(xlConstants, xlTextValues) If Right(C.Value, 1) = "-" Then If IsNumeric(Left(C.Value, Len(C.Value) - 1)) Then If C.NumberFormat = "@" Then C.NumberFormat = "General" C.Value = -CDbl(Left(C.Value, Len(C.Value) - 1)) End If End If Next End Sub Wolf "steve1961" wrote: I am importing numbers that has the minus sign to the right of the number. I need a macro that can move the minus sign to the right of the number. I used to have one but must have copied in incorrectly. What I has so far is.. Sub move_minus_left() Dim currentcell As Object For Each currentcell In Selection If Right (currentcell.Value, 1)="-" Then currentcell.formula="-"&left. I really really need help with this as soon as possible. Thank you Very Much! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try this instead
Sub move_minus_left() For Each c In Selection If Right(c, 1) = "-" Then _ c.Value = "-" & Left(c, (Len(c) - 1)) Next End Sub -- Don Guillett SalesAid Software "steve1961" wrote in message ... I am importing numbers that has the minus sign to the right of the number. I need a macro that can move the minus sign to the right of the number. I used to have one but must have copied in incorrectly. What I has so far is.. Sub move_minus_left() Dim currentcell As Object For Each currentcell In Selection If Right (currentcell.Value, 1)="-" Then currentcell.formula="-"&left. I really really need help with this as soon as possible. Thank you Very Much! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Minus Sign | Excel Discussion (Misc queries) | |||
Excel 2007 - display negative numbers with minus sign and parenthe | Excel Discussion (Misc queries) | |||
I do not want the minus sign | Excel Worksheet Functions | |||
minus sign | Excel Worksheet Functions | |||
I want to display the minus sign | New Users to Excel |