Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheetfunction Substitute
Sub PurchaseReport()
Dim JDEdata 'Correct JDE Credit Format Range("G4").Select For x = 4 To myRows JDEdata = Range("G" & x) If Right(JDEdata, 1) = "-" Then JEData = "-" & Left(JEData, Len(JEData) - 1) End If Next x End Sub -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Helen" wrote in message ... This macro is supposed to reformat numbers that have a "-" sign in them. Placing the "-" at the front instead of the end of the number. I'm getting an error message asking me to define the sub / function, what have I done wrong? Sub PurchaseReport() Dim JDEdata 'Correct JDE Credit Format Range("G4").Select For x = 4 To myRows JDEdata = Range("G" & x) If Right(JDEdata, 1) = "-" Then Application.WorksheetFunction = Substitute(JDEdata, "-", , 1) Application.WorksheetFunction = Substitute(JDEdata, Left(JDEdata), "-" & Left(JDEdata), 1) End If Next x |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :( | Excel Discussion (Misc queries) | |||
Can't use WorksheetFunction | Excel Discussion (Misc queries) | |||
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? | Excel Programming | |||
WorksheetFunction | Excel Programming | |||
worksheetfunction | Excel Programming |