Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :( [email protected] Excel Discussion (Misc queries) 6 May 22nd 08 05:33 PM
Can't use WorksheetFunction Yossi Excel Discussion (Misc queries) 5 January 25th 06 10:07 PM
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? Etien[_2_] Excel Programming 3 January 13th 04 04:07 PM
WorksheetFunction Stuart[_10_] Excel Programming 3 November 13th 03 12:33 AM
worksheetfunction devnext Excel Programming 1 October 29th 03 12:48 PM


All times are GMT +1. The time now is 03:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"