MIAGIRL57

New Member
Joined
May 8, 2012
Messages
4
I need coding such that if both of 2 cells (I335 & L335) are blank then some text "??????" will be put in another cell, but if this expression proves false I need the data in that cell (M335) to be left alone…
a formula can do this, i.e., =IF(AND(I335>0,L335>0),"????????????",M335)
but then of course no formula is in the cell, M335 for future use, reference, etc. So I wondered how you would do this with a macro? Any suggestions?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Welcome to the Board!

Something like this maybe:

<font face=Calibri><SPAN style="color:#00007F">Sub</SPAN> foo()<br>    <SPAN style="color:#00007F">If</SPAN> LenB(Range("I335").Value) = 0 And LenB(Range("L335").Value) = 0 <SPAN style="color:#00007F">Then</SPAN><br>        Range("E335").Value = "?????"<br>    <SPAN style="color:#00007F">Else</SPAN><br>        Range("E335").Value = Range("M335").Value<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>

HTH,
 
Upvote 0

Forum statistics

Threads
1,216,747
Messages
6,132,490
Members
449,730
Latest member
SeanHT

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