How can I write code to test if a cell is blank? My code is using "isempty" but I keep type mismatch error because my cells are filled with formulas that make the cells blank. It only works if the cells are truly empty with no formulas.
Thanks!
How can I write code to test if a cell is blank? My code is using "isempty" but I keep type mismatch error because my cells are filled with formulas that make the cells blank. It only works if the cells are truly empty with no formulas.
Thanks!
Try
If Range("A1").Value = "" Then
Ben Van Johnson
Thanks! Do you know how that would work in a For Each loop?
Hi,
For Each c In Worksheets("Sheet1").Range("A1:D10").Cells
If c.Value = "" Then
'' Do something
End If
Next
Where A1:D10 is the sample range i have taken as an example. Please change it accordingly.
Regards,
Paresh J
Click on "* Add Reputation" as a way to say thanks
Thank you so much!!
Like this?
![]()
Please Login or Register to view this content.
That seems like it'll work as well! Thank you!
NON vba soluition
with an helpcolumn
d1if empty it returns zero (0)![]()
Please Login or Register to view this content.
Notice my main language is not English.
I appreciate it, if you reply on my solution.
If you are satisfied with the solution, please mark the question solved.
You can add reputation by clicking on the star * add reputation.
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
Regards
Fotis.
-This is my Greek whisper to Europe.
--Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.
Advanced Excel Techniques: http://excelxor.com/
--KISS(Keep it simple Stupid)
--Bring them back.
---See about Acropolis of Athens.
--Visit Greece.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks