Remove simple multiplication from formulas in a selection of cells

shikiori

New Member
Joined
Oct 27, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have a sheet with a table of data that is copied and pasted as a Link, so each cell in the copied table contains a formula of the format =G41 (column / row obviously changes from cell to cell across the table referring to the source from which it was copied).

I have a series of 10 buttons with this macro modified and assigned to them, to allow the user to select cells and add a multiplier of 1 to 10 to the formulas in the selected cells. For example, user selects a bunch of cells and chooses to multiply them by 7 using the corresponding button. In the case of my example cell above, the formula is modified to be =G41*7.

Is there a macro that can be created to remove the multiplication from selected cells, where the multiplication may be the same or different (from 1 to 10) across the selection?

For example, user selects three cells that have had multiplication added to their formula, let's say =G41*7, =B32*7, and =C99*2 and presses this 'remove' macro and reverts the three cells to have formulas revert to =G41, =B32, and =C99. Something that removes all the characters to the right of the * (which I understanding in theory can be done) and then the * itself as well perhaps?

Complete Excel Luddite here, so I appreciate any help! TIA
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I have a sheet with a table of data that is copied and pasted as a Link, so each cell in the copied table contains a formula of the format =G41 (column / row obviously changes from cell to cell across the table referring to the source from which it was copied).

I have a series of 10 buttons with this macro modified and assigned to them, to allow the user to select cells and add a multiplier of 1 to 10 to the formulas in the selected cells. For example, user selects a bunch of cells and chooses to multiply them by 7 using the corresponding button. In the case of my example cell above, the formula is modified to be =G41*7.

Is there a macro that can be created to remove the multiplication from selected cells, where the multiplication may be the same or different (from 1 to 10) across the selection?

For example, user selects three cells that have had multiplication added to their formula, let's say =G41*7, =B32*7, and =C99*2 and presses this 'remove' macro and reverts the three cells to have formulas revert to =G41, =B32, and =C99. Something that removes all the characters to the right of the * (which I understanding in theory can be done) and then the * itself as well perhaps?

Complete Excel Luddite here, so I appreciate any help! TIA
Put the multiplication factor, the 7, into another cell, and refer to that cell in the formula. Change it to 1 when you want to remove the multiplication.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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