Add to code to trim additional character

klarowe

Active Member
Joined
Mar 28, 2011
Messages
389
Sorry to start another thread, but this question is completely different and was going to get lost in the other thread.. lol
Here is what I have:
Code:
...
If rng.Value <> "" Then
            Dmin = Val(Trim(Replace(Split(Dn.Offset(, 2), "-")(0), """", "")))
            Dmax = Val(Trim(Replace(Split(Dn.Offset(, 2), "-")(1), """", "")))
            If InStr(Dn, "-") Then
                temp1 = Val(Trim(Replace(Split(Dn, "-")(0), """", "")))
                temp2 = Val(Trim(Replace(Split(Dn, "-")(0), """", "")))
                Dn.Interior.ColorIndex = IIf(temp1 >= Dmin And temp1 <= Dmax And temp2 >= Dmin And temp2 <= Dmax, 4, 3)
            Else
...

Right now it trims out the [-] and ["] characters to establish my Dmin and Dmax / temp1 and temp2. I need to add the characters [/] and [\] to the trim if possible.

If not, its not a big deal.

Thanks in advance.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,224,802
Messages
6,181,054
Members
453,014
Latest member
Chris258

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