modify a vba code

BORUCH

Active Member
Joined
Mar 1, 2016
Messages
301
Code:
Sub changetoacertainpercentage()


Application.Run ("SelectBold")
Dim cell As Range, askedchange As Double, answer As String, answer1 As String
If ActiveCell.NumberFormat <> "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)" And ActiveCell.NumberFormat <> "$#,##0.00" And ActiveCell.NumberFormat <> "$#,##0.00_);[Red]($#,##0.00)" Then Exit Sub


answer = InputBox("What percentage you want to increase?")
answer1 = InputBox("What Penny Amount Do You Want It Rounded? ")
askedchange = 0.01 * Val(answer)


For Each cell In Selection
 
  If answer1 <> "" And cell.Value <> "" And IsNumeric(cell.Value) Then cell.Value = Application.MRound(cell.Value * (1 + askedchange), answer1)


If answer1 = "" And cell.Value <> "" And IsNumeric(cell.Value) Then cell.Value = cell.Value * (1 + askedchange)
Next cell
End Sub

Hi

i need help with modifying this vba code

I have in a cell that is formatted as currency a value, with text inside.
How can i have this code find only the numbers in that particular cell and change them accordingly for ex. in one cell i could have

$17.75 BX
$106.50 CS
(merge and center & wrap text)
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Watch MrExcel Video

Forum statistics

Threads
1,123,311
Messages
5,600,886
Members
414,414
Latest member
neil_c

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