replace minus values for values contain bracket

KalilMe

Active Member
Joined
Mar 5, 2021
Messages
343
Office Version
  1. 2016
Platform
  1. Windows
I got this code for @Rick Rothstein it's very efficiant . now I want if i run repeatedly then return the values to become minus and when the values is minus and run the macro then should contain bracket and so on every time run the macro should change from minus to bracket and bracket to minus
VBA Code:
Sub MakePlusMinusAndMinusPlus()
  With Range("A2:H" & Columns("A:H").Find("*", , xlValues, , xlRows, xlPrevious).Row)
    .NumberFormat = "General;(General)"
  End With
End Sub
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
This is a simple toggle that will work if all values are formatted the same. If you have combinations it wont.

VBA Code:
With Range("A2:H" & Columns("A:H").Find("*", , xlValues, , xlRows, xlPrevious).Row)
    If .NumberFormat = "General;(General)" Then
        .NumberFormat = "General"
    Else
        .NumberFormat = "General;(General)"
    End If
End With
 
Upvote 0
Solution

Forum statistics

Threads
1,214,979
Messages
6,122,557
Members
449,088
Latest member
davidcom

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
Back
Top