|
-
Feb 8th, 2010, 09:13 AM
#1
Thread Starter
Addicted Member
remove minus sign - code
write in excel as ( ) replace the minus sign
for example if it 12345.78-
the code replace in excel as (12345.78)
thanks in advance.
-
Feb 8th, 2010, 09:44 AM
#2
Re: remove minus sign - code
Try
Code:
Worksheets("Sheet1").Columns("C"). _
NumberFormat = "$#,##0.00_);($#,##0.00)"
-
Feb 8th, 2010, 09:50 AM
#3
Thread Starter
Addicted Member
Re: remove minus sign - code
i tried this one it does not work it works but the excel should show with () does not show this one
NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(* ""-""??_);_(@_)"
-
Feb 8th, 2010, 10:19 AM
#4
Re: remove minus sign - code
What are you exactly typing in Excel?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Feb 8th, 2010, 05:37 PM
#5
Thread Starter
Addicted Member
Re: remove minus sign - code
-
Feb 8th, 2010, 06:12 PM
#6
Re: remove minus sign - code
Unless cell was formated as number with trailing-minus, when entering 1275.50- that will be treated as text.
You need to convert that look-like-number-text to a number so the first 3 sections of the number format can be applied.
The quickest way is to use the built-in method TextToColumns to convert with
TrailingMinusNumbers:=True
Code:
Columns("A:A").NumberFormat = "_(#,##0.00_);(#,##0.00);_(""-""??_);_(@_)"
Columns("A:A").TextToColumns Destination:=Range("A1"), _
DataType:=xlDelimited, _
Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=False, _
FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|