If statement referring to a blank cell

I want to put an if statement in code that will say something like

If a1 is blank then

blah blah blah

end if

I can not seem to figure out how to refer to "blank"

0
3/16/2005 11:28:11 PM
excel 39879 articles. 2 followers. Follow

1 Replies
820 Views

Similar Articles

[PageSpeed] 55

papa

Sub blank()
If Range(A1").Value = "" Then 
    MsgBox "blah, blah, blah"
Else: MsgBox "halb, halb, halb"
    End If
End Sub


Gord Dibben Excel MVP

On 16 Mar 2005 15:28:11 -0800, "papa jonah" <adullam04-excelgoogle@yahoo.com>
wrote:

>I want to put an if statement in code that will say something like
>
>If a1 is blank then
>
>blah blah blah
>
>end if
>
>I can not seem to figure out how to refer to "blank"

0
Gord
3/17/2005 12:03:49 AM
Reply:

Similar Artilces:

Random Locked cells
I am having a problem with a spreadsheet that has random cells locked. The only way to unlock them is to copy and paste a blank cell that isn't locked into the cell that is locked, but this doesn't always work either Has anyone had this type of problem? Any ideas Thanks Leonar lmack@usccs.co Hi Leonard Maybe I don't understand you correct but if you select a cell or cells and right click on it and choose Format Cells you can change the locked on the Protection Tab -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Leonard Mack" <lmac...

selecting cells #4
When holding down ctrl to select a number of cells to format them or see the sum in the bottom of the screen - and you accidentally select one you dont want - is there a way to unselect that one without starting over ? Thanks, Yosef Take a look at this: http://www.cpearson.com/excel/unselect.htm there's no builtin way to do it, other than starting over... -- Regards, Juan Pablo Gonz�lez Excel MVP "ynissel" <ynissel@discussions.microsoft.com> wrote in message news:9EA0DDD8-4668-430B-BB5E-C15549FC9346@microsoft.com... > When holding down ctrl to select a number ...

format cell type
Hi everyone, in a spreadsheet, I have a complex data type that I want to sort correctly. The format contains a prefix that contains both letters(A) and numbers(0) followed by a suffix after a hyphen and another number. Example: 000A0000-1 and 000A0000-10 The thing Excel is messing up in, is if the complete prefix (000A0000) is the same, but a different number after the hyphen, it sorts it 1, 10, 11, 12, 13, ..., 2, 20, 21, 22, ... 3, etc. I was wondering if anyone knew how to set up a custom format type that will allow a suffix stored as text and the suffix after the hyphen stored as a n...

VLookUp and DropDown List in the same cell
Hi everyone, I know that this is possible but I'm not sure how to accomplish this. In column E, I have a list of zip code. In column I, I have the "Priority" category. Priority will be based on the zip code in column E. This will be accomplished by VLookUp formula, where I will have a separate sheet store all the zip codes and the priorities (ie. Priority #1, Priority #2 and so on). The challenge part is that column I "Priority" column needs to be able to use as a Drop Down List as well, in case that the VLookUp formula needs to be overridden for s...

[newbie] reference <> pointer
Hi, I was just wondering: What's faster, passing a reference to a function or passing a pointer (or is that equal in terms of speed)? void MyFunc(MYSTRUCT &mystr) { if(mystr.a == 1)... } or void MyFunc(MYSTRUCT *mystr) { if(mystr->a == 1)... } Can anyone tell me what's faster? Thanks a lot Peter point faster; reference is advanceed way,take much resoure "Peter Schmitz" <PeterSchmitz@discussions.microsoft.com> д���ʼ� news:A1FC9E5A-990A-40A3-9BF7-FFA255FE74AF@microsoft.com... > Hi, > > I was just wondering: What's faster, pass...

Sorting cells #2
When you try to sort certain data by selecting the cells, but leaving adjacent cells unselected, you get a "sort warning" asking if you would like to expand the selection. How do you stop this from happening? Joey If you are selecting cells in one column or row only you will get this message. I have never found a way to prevent it. Hopefully we both can learn something here. Gord Dibben Excel MVP On Mon, 24 Jan 2005 13:39:05 -0800, "JoeyJoeJoe" <JoeyJoeJoe@discussions.microsoft.com> wrote: >When you try to sort certain data by selecting the cells, but lea...

Pivot Table Data Source, point to cell?
Is there any way to point the data source block to a cell. I want to simply update a cell (i.e. A1) with the range instead having to open the pivot table and changing from the wizard. Is there a way to do this? Example: Cell A1 contains: '[Output 3.24.xls]FORMALS-OUT'!$A$5:$P$65536 Data source in pivot table points to cell A1 to get the range. please tell me there's a way to do this.... thanx.! hi, Jeremy ! > Is there any way to point the data source block to a cell. > I want to simply update a cell (i.e. A1) with the range instead having to open the pivot table >...

If statement #18
Windows 2000 / Excel 2002 Can if statement in Excel use and?? =IF(G40 > N5 and G40 < N4,"OKay","NO") Do I have to do a nested to get this? Thank you use IF(and(G40 > N5, G40 < N4),"OKay","NO") "FGM" wrote: > Windows 2000 / Excel 2002 > > Can if statement in Excel use and?? > > =IF(G40 > N5 and G40 < N4,"OKay","NO") > > Do I have to do a nested to get this? > > Thank you > Hi! =IF(AND(G40>N5,G40<N4),"OK","NO") Biff "FGM" <a...

How do I display a text message when a cell has a certain value??
Hi, I have a cell where if the cell is empty (A1=0), then I would like the cell to display "Enter your value here." Otherwise, I would like the cell to display the value a person enters. I have tried using an if/then/else statement and, understandably, I get a circular reference error: =IF(A1=0,"Enter your value here",A1) Does anyone have a suggestion? Thanks! Why not just enter the text itself? The value entered by the user will displace (replace) it. This should work if the form is a template. -- HTH, RD ===================================================...

Counting Text Cells #2
Hi Guys, How can I determine the most common occurence of a word in a lis formatted as text in Column A. I would like a function that simpl returns the word that occurs the most to appear in cell D1. Also, i there are two words that occur the same number of times in this list, would like both words to be shown (one in D1, one in D2). Any suggestions? Thanks, Be -- Message posted from http://www.ExcelForum.com Hi to get the most frequent text entry try the following array formula (entered with CTRL+SHIFT+ENTER): =INDEX($B$1:$B$20,MODE(MATCH(IF($B$1:$B$20<>"",$B$1:$B$...

Why doesn't what I enter in the function bar appear in the cell?
I have a workbook that contains several copies of a master template worksheet. On one of these sheets when I enter text, it appears correctly in the function bar, but appears as a string of &s in the cell. This has only just occurred, and as far as I know used to work OK, i.e. it used to appear as text in the cell. What could cause this and what do I need to do to put it right? You wrote that the text appears as apersands (&). Did you really mean octothorpes (#)? If yes, then try formatting that cell as General--or anything but Text. Chris Mitchell wrote: > > I...

Adding text to a vlookup cell
Can a cell be edited if the contents are the result of a vlookup function and still keep the rseults? I have 2003 on an XP Pro PC. My formula is =IF(A4<>"",VLOOKUP(A4,InvDetail!$A$2:$B$3000,2,FALSE),"") I trying to create an availability list for our customers but need to add comments to the end of some items. I know I can add another column but the customers are used to the comment being after the item description and space on the page is limited. Thanks, Lee Coleman If you're talking about entering comments manually, then you'd need to concatenate th...

Worksheet reference
OK it finaly work but i want to know if we can ajust this for the copy sheet sheet1 (1), sheet1 (2)... Thanks Roch ...

Reference #3
I would like to make reference to a cell in a worksheet in a second excel file. However, I would like the worksheet to be variable. Normally you use the following link: '[Excelfile 2.xls]worksheet'!$c$2 The name of the worksheet to be used is a fixed value in the first file, placed in cell A1. Is it possible to use a link like '[Excelfile 2.xls]Sheet($a$1)'!$c$2? The part Sheet($a$1) does not work as a reference. Who can help? -- Thx You can do something like this, but the second workbook has to be open. INDIRECT will not work with a closed file. =INDIRECT("[Book...

Need help formatting a cell.
Can such a request be done using Excel? I need to enter a time in Cell B18 of 2325 or 11:25pm from that time i need it to calculate that cell B17 is 15 minutes prior to B18 (2310 or 11:10pm) B16 is 20 minutes prior to B18 (2305 or 11:05pm) B15 is 45 minutes prior to B18 (2240 or 10:40pm) B14 is 1 hour prior to B18 (2225 or 10:25pm) B13 is 1 hour 10 minutes prior to B18 (2215 or 10:15pm) and so one...... When i will need to change cell b18 to another time.... I need all my cells to still have the same minutes prior to be calculated and deducted. Sorry if questions is compliacted and conf...

Problems downloading E*TRADE statements
I am using Money 2007 and downloading (not importing) transaction statements from E*TRADE. When the statement contains interest or divident transactions Money insists on assigning an investment to those transactions? How can I get Money to treat those transactions as cash only transactions? When Money matches a downloaded stock transaction with an entry I manually created, Money overwrites the transaction details, so instead of seeing e.g. purchased 100 MSFT at 100, I just see Jdbl. How can I get Money to clear the transaction, but not overwrite the transaction details? Regards Pieter...

How do i select different cells to be use in a formula.
Hi I need to know how to select different cells to be used in a formula, but i don't know what is the separator that i need to use to this, see the example bellow Cells that i need to include on my formula: A1 C5 BH32 Thanks. Hi you didn't mention what formula but here's a starting point: =AVERAGE(A1,C5,BH32) or depending on your regional settings =AVERAGE(A1;C5;BH32) hope this helps Cheers JulieD "Manuel" <Manuel@discussions.microsoft.com> wrote in message news:A855A562-725C-4B10-B111-A88F7A767122@microsoft.com... > Hi > > I need to know ho...

create defined name using variable file name in reference
please help in create defined name EXAMPLe: create name : ACCPath ---- Referes to (='E:\Data Folder\[externa work book.xlsx]sheet1'!$K$8:$K$10000) this works I NEED to put (external work book.xlsx) in a cell and refere to it as variable in the referes to (='E:\Data Folder\[&U2&]sheet1'!$K$8:$K$10000) where U2 having the file name because it is changing meny times Activeworkbook.Names.Add Name:="ACCPath", RefersTo:= "=" & Activesheet.Range("U2").Value2 --- HTH Bob Phillips "hala" <hala@discussions.mi...

cell color #5
Dear All, My OS is WindowsXP pro and Office is 2003. In WindowsXP, there are many users, now there is one user in Excel, after apply the fill color, the color can not appear, only in Print Preview can see the color applied. help pls. thank you berry See this: http://support.microsoft.com/?id=320531 Biff "berrylei" <berrylei@discussions.microsoft.com> wrote in message news:7EE1354C-542D-4EDB-BDE6-52FDB6A3C78B@microsoft.com... > Dear All, > > My OS is WindowsXP pro and Office is 2003. > In WindowsXP, there are many users, now there is one user > in Excel...

Run macro based on cell value in worksheet
Does anyone know of a way to do run a macro based on a cell value. EG i cell A1 = 0, dont run macro - otherwise run macro -- Message posted from http://www.ExcelForum.com Does anyone know of a way to do run a macro based on a cell value. EG i cell A1 = 0, dont run macro - otherwise run macro. below macro will run your code is cell a1 is anything but 0. Do you want the macro to run automatically if a different value i inputted into cell a1, or are you happy for the user to run the macr manually? (if automatically, more code is required) sub Macro 1 () if cells(1,1) = 0 then exit sub &...

IF Statement Question
Hello, I have the following statement that does what I want =IF(G10=3,-3,IF(G10=4,-2,IF(G10=5,-1,IF(G10=9,1,IF(G10=10,2,IF(G10=11,3,0)))))) If the random number is between 3 and 11, a value is generated, my problem is if the number is either a 2 or a 12, I want to get another number For example Random Number List 1 List 2 2 --- 8 7 0 n/a 12 --- 4 So if a number is between 3-11,...

excel-i want it to go to a certain cell when i 1st open the sheet
when i open a spreadsheet that i created, how do i get the cursor to go to the cell i want it to.. in this spreadsheet i will have to enter information in different columns and i want it to automatically go to the first cell under the first column. how can i do this? Hi Lindsey, I can think of two options off the top of my head: 1) Go to the cell, save and close. The next time you open the workbook, the active cell will be the same cell. 2) Use Excel Events. This requires programming Excel using VBA and when done properly can be extremely useful !!! The desired cell will always be t...

Copy whole table into one cell
Office Excel 2003 on Windows XP I'm trying to create a report-maker with excel... ugh! Anyways, there is a template that users are filling out saying whether something is defected or not... that's not important, the important part is, that I'm having VBA go though the table (using a button after it is filled out) and deleting the rows that aren't defected... in other words, if there are blank cells in column C (for example), the whole row in which that blank cell is located is deleted. I'll never have more than 40 rows and 5 columns in the table so I don'...

Extract different strings from a cell?
If I have "100BDDDABAABD" in a cell and I'd like to extract the last 10 characters and put each character into a different cells. Then, the first rest of characters (first 3 in this case) into another cell. How do I do that in Excel? Thanks, Since you said "first 3 in this case", I'll assume that the number of characters will vary in each cell. With data in A1, enter this in B1, and copy across to K1: =MID(RIGHT($A1,10),COLUMNS($A:A),1) Then, in L1, enter this for the remaining characters: =LEFT(A1,LEN(A1)-10) -- HTH, RD -----------------------------------...

resize control checkbox with cell
First question: One of the tab in my workbook has several checkboxes arranged in a number of columns. One of the set is over the cells, say, A1:A20. I would like to attach these checkboxes to the cell they belong to so that they will have exactly the same size with their cells, and resized along with the cells. Is this possible? Second question: How much overhead does control checkbox has over simply using cell.value = "Y" or "N" ? I just saw an answer to another post concerning toggling a cell between "" and "X". If this works, I could remove ...