Vba help

Isabella

Well-known Member
Joined
Nov 7, 2008
Messages
643
Hi, i need a code that will remove 0.00 in row 6, my data is layed out like this in row 6

<TABLE style="WIDTH: 288pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=384 border=0 x:str><COLGROUP><COL style="WIDTH: 48pt" span=6 width=64><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 48pt; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=64 height=17>Total</TD><TD class=xl23 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 48pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" align=right width=64 x:num>0.00</TD><TD class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 48pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=64>Total</TD><TD class=xl23 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 48pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" align=right width=64 x:num>0.00</TD><TD class=xl22 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 48pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=64>Total</TD><TD class=xl23 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 48pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" align=right width=64 x:num>0.00</TD></TR></TBODY></TABLE>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Mark F

Well-known Member
Joined
Jun 7, 2002
Messages
507
Office Version
  1. 365
Platform
  1. Windows
How about, Highlighting row 6 and formyat cells, number, Custom, replace "General" with a semicolon

This should show zeros as blank

Not sure whether that will work for you?

Mark:)
 
Upvote 0

Isabella

Well-known Member
Joined
Nov 7, 2008
Messages
643
ADVERTISEMENT
How about, Highlighting row 6 and formyat cells, number, Custom, replace "General" with a semicolon

This should show zeros as blank

Not sure whether that will work for you?

Mark:)


since i have a VBA code that exports data, i will incoporate this into the procedure, i just ran a macro recorder to record the steps, can the be simplified?


Sub Macro1()
'
' Macro1 Macro


Rows("6:6").Select
Selection.NumberFormat = ";;"
Range("A6").Select
End Sub
 
Upvote 0

Mark F

Well-known Member
Joined
Jun 7, 2002
Messages
507
Office Version
  1. 365
Platform
  1. Windows
Hi

Just realised that the Number Format I suggested is not exactly correct! I think you what you actually need is
0.00;-0.00;
with the last semicolon making Only Nils show as blank

The first is format for positive numbers, second is for negative numbers, third is for nils

You may have found already that
will show no numbers at all :eek:

Mark
 
Upvote 0
L

Legacy 68668

Guest
If it is not populated by a formula then try
Code:
Dim x As String
With ActiveSheet
    With Intersect(.UsedRange, .Rows(6))
         x = .Address
        .Value = Evaluate("if(" & x & "<>"""",if(" & x & "=0,""""," & x & "),"""")"
    End With
End With
 
Upvote 0

Forum statistics

Threads
1,195,650
Messages
6,010,920
Members
441,572
Latest member
keobongda8812

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
Top