Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank an excel cell in VBA 1

Status
Not open for further replies.

Ham

Technical User
Feb 23, 2000
122
US
I have a spreadsheet with a blank cell that is tested for blank in some other calculations. Initially, it works fine. It also works when data is entered. From the keyboard I can use delete to clear the cell and it is again tested as a blank. However, I have not been able to do the equivalent of delete in VBA. No matter what I do, the ISBLANK creates #VALUE! throughout.

Any suggestions would be greatly apppreciated. Thanks. -- Ham
 
I just switched the ISBLANK to ISEMPTY and now I get a #NAME error. -- Ham
 
Sorry misread your post.

Select the cell and then use

Selection.Clear


You might be able to just get round it by using

Range("A1").Clear
 
Thank you for your help. It turned out to be simple, stupid programming error that I had been staring at too long to notice. It's amazing what a short break can accomplish.

Thanks again. Ham
 
ISBLANK isn't available in VBA
ISEMPTY isn't available to the worksheet
(I think!!)

If you want to delete/clear/remove something in a cell using VBA look at the Delete & Clear methods of the Range object

eg Range("A1").Clear
Then IsEmpty(Range("A1")) will return TRUE in VBA

Or am I missing the point here?

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Ignore that
Last two posts weren't there before!!!

Happy Friday
;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top