Help with building double if statement

sobieskitech

New Member
Joined
Dec 13, 2017
Messages
5
Hello all,

I've looked for solutions to this is the Forum and have probably just missed it.

With the example below I would like to do the following:
1. Look in column D and if the first 3 characters of the cell is BAL then,
2. Look in column C and determine if the character preceding the dash is a letter
3 If the last 2 statements are true then replace the "-00" with ""
like this
Code:
Selection.Replace What:="-00", Replacement:=""

CD
1301640A-00BAL_OS361D
2301501B-00BAL_OS361F
320392C-00BAL_OS366B
4ASGQHAR01001-00BAL_OS363F

<tbody>
</tbody>


then continue looping till the end of the page.

Thanks in advance for any help
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
See if this works. Test on a copy as its going to overwrite your data:

Code:
lr = Range("C" & Rows.Count).End(xlUp).Row
 
Set x = Range("C1:C" & lr)
x = Evaluate(Replace("IF(ROW(1:" & lr & "),IF(ISERROR(MID(@,FIND(""-"",@)-1,1)+0),IF(LEFT(OFFSET(@,0,1),3)=""BAL"",SUBSTITUTE(@,""-00"",""""),@),@))", "@", x.Address))
Range("C1:C" & lr) = x
 
Upvote 0

Forum statistics

Threads
1,213,539
Messages
6,114,221
Members
448,554
Latest member
Gleisner2

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