LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 262
Default How can I get an empty cell with a formula

I have a routine that runs when I save the workbook. It looks along rows 3 -
23 and columns A - AF. If there is an entry in any of the cells in a row
then the cells for that row in columns D - G must have a value.

The mail part of the code looks like this:

If Application.CountA(Range("A" & i & ":AF" & i)) 0 And
Application.CountA(Range("D" & i & ":G" & i)) < 4 Then

where i is the value in a for next loop going from 3 - 23.

This routine works great. Unfortunatly I now need column E to be
automaticaly entered based on a Vlookup and the value in column D. The
formula for E is:

=IF(D3<"",VLOOKUP(D3,HospitalCity,2),"")

This works as well but for some reason column E now has a count of 1.

Is there any way that I can have the Counta of column E equal 0 if there is
no entry in it?I have a routine that runs when I save the workbook. It looks
along rows 3 - 23 and columns A - AF. If there is an entry in any of the
cells in a row then the cells for that row in columns D - G must have a value.

The mail part of the code looks like this:

If Application.CountA(Range("A" & i & ":AF" & i)) 0 And
Application.CountA(Range("D" & i & ":G" & i)) < 4 Then

where i is the value in a for next loop going from 3 - 23.

This routine works great. Unfortunately I now need column E to be
automatically entered based on a Vlookup and the value in column D. The
formula for E is:

=IF(D3<"",VLOOKUP(D3,HospitalCity,2),"")

This works as well but for some reason column E now has a count of 1.

Is there any way that I can have the Counta of column E equal 0 if there is
no entry in it?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula for empty cell collyer3 Excel Worksheet Functions 2 December 4th 08 01:45 PM
format a cell with a formula so an empty reference cell shows blan M2 Excel Discussion (Misc queries) 3 November 7th 06 10:42 PM
formula, move to previous cell when the current cell=0 or empty osama amer Excel Discussion (Misc queries) 0 May 29th 06 12:18 PM
How do I leave formula cell blank if 2nd reference cell is empty? Liana S Excel Discussion (Misc queries) 2 October 21st 05 04:38 PM
Can I empty the cell who has formula in it Man Utd Excel Worksheet Functions 4 June 16th 05 07:15 PM


All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"