MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Macro to remove brackets

  Asked By: Alex    Date: Jan 26    Category: MS Office    Views: 1890

I am working on a worksheet which has monthly payroll. Ineed to make a
macro which will go to the cell on the left, and remove a bracket in it
and a multiplication function.

For e.g. if A1 has =(221.86+1.15+3.75)*2 I need the macro to work in A2
to remove the brackets and the *2. If I create the macro by keystrokes
then whenever I am I get the same result as A1. So I need to use vb
but dont have a clue of the commands.

Can anyone please help?



2 Answers Found

Answer #1    Answered By: Bama Cohen     Answered On: Jan 26

You don't need VBA to accomplish your task.

Save the workbook, then do the following:
1) With the replace function, replace "=" with "'="

Now you have only text.

2) Replace ")*2" with ""

3) Replace "(" with ""

4) Replace "'=" with "="
Or simplified, just replace "*2" with "". That will also do the trick

Answer #2    Answered By: Hadil Khan     Answered On: Jan 26

The brackets  can be left  where they are. A find/replace for *2 will find
and remove  the multiplications.

Or is there something more complex in what you need to do?

Didn't find what you were looking for? Find more on Macro to remove brackets Or get search suggestion and latest updates.