Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-01-2020, 04:50 PM
Guessed's Avatar
Guessed Guessed is offline VBA to extract/hide text by font color? Windows 10 VBA to extract/hide text by font color? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The way I would do this is to add a third column containing a formula which reports on whether the second column is formatted as Red or not. I don't know if there is a built-in formula that can do this so I added one as a VBA custom function.



Once you have a column that returns either true or false for your trigger, you can convert the content to a table and use the filter dropdowns to hide the black or red rows.

The custom function is:
Code:
Function RedCell(aRng As Range) As Boolean
  RedCell = aRng.Font.Color = RGB(255, 0, 0)
End Function
Once that macro is in your workbook, you can use a formula in any cell like
=RedCell(B2)
Attached Files
File Type: xlsm LanguageFiltering.xlsm (18.7 KB, 8 views)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 09-02-2020, 03:54 AM
tyxanu tyxanu is offline VBA to extract/hide text by font color? Windows 8 VBA to extract/hide text by font color? Office 2013
Novice
VBA to extract/hide text by font color?
 
Join Date: Aug 2020
Posts: 13
tyxanu is on a distinguished road
Default

So I am trying to create a button from scratch based on your indications

And I am getting "Compile Error: Expected End Sub". Please note that i am relatively new to VBA in Office

What am I doing wrong in this file below?
Attached Files
File Type: xlsm test.xlsm (18.4 KB, 8 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to extract/hide text by font color? How to extract text between <> LearnerExcel Excel 4 02-07-2018 06:11 AM
Formula to Extract text from a text string Haha88 Excel 2 11-14-2017 01:32 AM
Advanced Font Color Manipulation In Word: Inserting another color than the surrounding text stuartg Word 1 02-20-2017 12:38 AM
VBA to extract/hide text by font color? Text Field [content control] - Default text color vs Filled Text color jackcoletti Word 3 02-01-2017 08:10 AM
VBA to extract/hide text by font color? Remove white text background (keeping the font color and page color intact cc3125 Word 1 10-26-2015 06:44 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft