cell fomatting

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Cell fomatting

Cell fomatting

resolvedResolved · Medium Priority · Version 2003

Steven has attended:
Excel VBA Intro Intermediate course

Cell fomatting

Is there a VBA method to clean a large amount of data, leaving e.g. #NA/NA cells empty and keeping proper numbers in a desired format?

RE: cell fomatting

Hi Steven

Thanks for your question

The following code uses the IsError property of the range object to determine whether the cell contains an error. If it does, it changes the value to and empty string ""



If IsError(Range("A1").Value) = True Then

Range("a1").Value = ""

End If


This code checks cell "a1", but you could place this in a loop and have the range determined as a variable so that it would cycle through a range of cells

Regards

Stephen

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Use the SUBTOTAL function in Excel

You can create subtotals in your spreadsheet using the SUBTOTAL function, which looks like this:

=SUBTOTAL(9,cell:cell)

9 represents the function being used (SUM), followed by the range of cells the function is operating on.

The neat thing about using the Subtotal function is that if you have used it several times in the same column or row, clicking on the AutoSum button at the end of the column or row will make Excel add only the results of cells containing the Subtotal function in that column or row.

View all Excel hints and tips


Server loaded in 0.07 secs.