Hi Guys,
What VBA codes should i put when i need to conditional formatting A1:A10 if their is text specific "#N/A" in white font and white background?
thanks guys!
Hi Guys,
What VBA codes should i put when i need to conditional formatting A1:A10 if their is text specific "#N/A" in white font and white background?
thanks guys!
Why do you want to do it using VBA? You can do it using Conditional Formatting or even better using an IFERROR in front of your formula in these cells, forcing your formula to don;t gives to you #N/A values..
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.
same query as fotis but if you really want it to be done i did something similar recently
http://www.excelforum.com/excel-prog...91#post3335591
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
sorry for the confusion.
im currently working on some VBA template and there is a DATA that is paste value as #N/A and i just need to code it on vba when the code finds #N/A on my data it will automatically white their fonts and background as well.
oK. I am not able to help you using VBA. I hope someone will be able to do this. But i suggest you to pm an online Moderator to moove your thread in VBA section.
DON'T start a new thread. It's will be a duplicate thread..
to get white background
.Interior.colorindex = 2
to get white font
.Font.colorindex = 2
Sub ConditionalFormat() Dim I As Integer I = 1 For I = 1 To 10 If IsError(Cells(I, 1).Value) = True Then Cells(I, 1).Interior.ColorIndex = 2 Cells(I, 1).Font.ColorIndex = 2 End If Next I End Sub
Last edited by humdingaling; 07-25-2013 at 05:12 AM. Reason: based on error and not text "N/A"
thanks it is now working! whohoooo!
Or else u can use ISNA function, because this is mainly designed to handle #N/A error value.
For i = 1 To 10
If Application.WorksheetFunction.IsNA(ActiveCell.Value) = True Then
ActiveCell.Interior.Color = vbWhite
ActiveCell.Font.Color = vbWhite
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Next
janagan,
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE] [/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
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks