Here is the formula I made
=IF(B2<" ","","=LEFT(C2,3)&LEFT(D2,2)")
Basically I want to return a formula if b2 has text in it.
This way it only returns it has text instaed of calculating.
I know this should be easy but I have drawn a blank.
Here is the formula I made
=IF(B2<" ","","=LEFT(C2,3)&LEFT(D2,2)")
Basically I want to return a formula if b2 has text in it.
This way it only returns it has text instaed of calculating.
I know this should be easy but I have drawn a blank.
Re: if formula
=IF(B2="","","=LEFT(C2,3)&LEFT(D2,2)")
In this example, if B2 is not equal to nothing then the formula is produced. The formula is produced as text and is not calculated.... Are you sure this is what you want?
Alastair
Re: if formula
Try using ISTEXT:
Should do what you want.
<edited to say> Actually, you probably want it the other way around....
- this activates the 'LEFT...' bit if B2 is a text value and sets it to nothing if non-text...
Re: if formula
Yep that works. I knew it was going to be something that simple. A had it in and out of "" but I never thought to drop the = sign. Sometimes My mind just goes on the fritz. So thank you again Norie.
Re: if formula
Sometimes while your typing so are other people.
Those other post I didnt see till after Mine.
So after lots of playing around I went with
=IF(ISTEXT(B7),LEFT(C7,3)&LEFT(D7,2),"")
It only triggers on text if the cell is blank or ther is number then it does nothing. Which I never really thought about until I played with al the fomulas.
So after playing around with those I thought "man it would be cool to throw that in some code so I wont have to drag the cells every time I add a new line."
So I type out this
And then I realized, I ignorant I really am.
So do you guys think you could me out? :thanx:
Re: if formula
I added the code to the sheet. And it works but not completely. The formula was incorrect so I tried to replace it with the correct and received errors. Tried to adjust the ranges to work on a permanent sheet and instead of it seeing the same row values it jumped, row 4's formula referred to row 932 and so on.
Re: if formula
The error I was getting was because in vba I have to put the quatation marks inside quatation marks.
I droped the second line of code and that fixed my other problem.
So problem solved, Thank you guys for all your help! :facepull:
Don’t have an account yet? Register yourself now and be a part of our community!