If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > if cell is blank, change the value, otherwise do nothing

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-18-04, 10:04
jjay jjay is offline
Registered User
 
Join Date: Mar 2004
Posts: 10
if cell is blank, change the value, otherwise do nothing

Hello,

I'm new here, and I have a simple question:

=IF(K7="","15,962",do nothing)

how do I do the "do nothing" part?

Thanks,
JJ
Reply With Quote
  #2 (permalink)  
Old 03-18-04, 10:07
texasalynn texasalynn is offline
Registered User
 
Join Date: Jun 2002
Location: Houston, TX
Posts: 116
Do you want the words? Then just put quotes around it. If you want the answer to be blank type two quotes "" together.

HTH
texasalynn
Reply With Quote
  #3 (permalink)  
Old 03-18-04, 10:16
jjay jjay is offline
Registered User
 
Join Date: Mar 2004
Posts: 10
Quote:
Originally posted by texasalynn
Do you want the words? Then just put quotes around it. If you want the answer to be blank type two quotes "" together.

HTH
texasalynn
Sorry, I should have been more specific.

I don't want the words or for it to be blank. I am importing data into the worksheet from a database. So I have some defualts I would like to use if the user has neglected to enter the necessary data.

=IF(K7="","15,962",do nothing)

So If the data was imported and there is a value, then do nothing.

Thanks,
JJ
Reply With Quote
  #4 (permalink)  
Old 03-18-04, 11:10
texasalynn texasalynn is offline
Registered User
 
Join Date: Jun 2002
Location: Houston, TX
Posts: 116
So where are you putting the formula?? It has to have a true and false. Otherwise you can't use and IF statement

texasalynn
Reply With Quote
  #5 (permalink)  
Old 03-19-04, 07:56
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
If you want to put a specific value in the cell's which are blank.
Then do the following

write what you want in a blank cell somewhere
(In your case 15,962)
copy it
Highlight the area you want to update the blanks
Go to Edit -> Go To
then click the options special cells
choose the Blanks option
Click Ok
then Paste

this will paste your data into all the blank cells in your area.

You also could write a Macro to do this Automatically

Hope this Helps
David
Reply With Quote
  #6 (permalink)  
Old 03-19-04, 08:49
jjay jjay is offline
Registered User
 
Join Date: Mar 2004
Posts: 10
Thanks - I got it to work with this macro

' Planned Withdrawals Default to 0
Sheets("InputData").Select
Range("d20").Select
Val = Selection.value
If Val = "" Then Selection.value = "0"
Reply With Quote
  #7 (permalink)  
Old 03-19-04, 09:51
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
Re: Thanks - I got it to work with this macro

Hi JJay

Just an idea if you would like it
you could use this macro to fill all blank cells in column D at once
if this would Help.

Code:
Sub FillBlanks()
    Dim Lastrow As Double
    'Fills Blank Cells with the Value of 0
    
    Worksheets("InputData").Activate
    
    'get Last row of data assume Column A has data on Lastrow
    Lastrow = Range("A65000").End(xlUp).Row
    'fill all blank cells within data range to 0
    Range("D2:D" & Lastrow).SpecialCells(xlCellTypeBlanks).Value = 0
End Sub
Ive made 2 Assumptions that Column A has data in the final row of your data.
and there are no more than 8192 seperate ranges of blank cells in this column.

David
Reply With Quote
  #8 (permalink)  
Old 03-19-04, 09:56
jjay jjay is offline
Registered User
 
Join Date: Mar 2004
Posts: 10
Thanks David - that's good to know

But my input page has cells scattered around in different sections so it's not a continuous column. Thanks for giving it some thought though. I have about 20 different cells in different areas of the sheet so I just wrote out that small piece of code 20 times and had it run before the rest of the module.

JJ
Reply With Quote
  #9 (permalink)  
Old 03-19-04, 10:18
jjay jjay is offline
Registered User
 
Join Date: Mar 2004
Posts: 10
Thumbs up Re: Thanks - I got it to work with this macro

How do you rate a member? Yours could use a boost.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On