I ran into a peculiar behavior today that I need help with. I have a range(A2:C3) that I'm using conditional formatting to hide based on a yes/no dropdown (A1). It basically sets font/border/and bg color to white. There's a cell with a hyperlink (A3) to clear the contents of the range (A2:C3) which should be included when the range formatting is changed.
It works well until you click the link, then it isn't included with the range for conditional formatting for some reason. Any ideas on a solution to get followed hyperlinks to behave as new hyperlinks? I'd like to keep everything within the conditional formatting scheme to save myself a heap of work but if VBA is needed that's fine. Thanks!
Select the column, row or cells.
Format Cells
Uncheck normal font.
:)
This deselects auto formating for things like hyper links.
Related
I was curious how to do temporarily turn off Conditional Formatting in excel for a subset of my cells and I didn't see an answer so I'll post a solution and see if others have a better solution.
This is what worked for me:
I just highlighted all the cells which will bring up all the rules
applicable to all the cells. So just made a 'square' selection of
the cells. Its fine if it has a mix of Conditional Formatted cell
and regular non-formatted cells (the Manage Rules will only list the cells which actually have Cond Formatting rules applied to them).
click ConditionalFormatting->Manage Rules
Add a rule at the very top which applies to all these cells.
a. set the 'Rule' text to '=TRUE()' (without the apostrophe's)
b. set the 'Format' to 'No Format Set' (aka by setting a white background)
c. leave the 'Applies to' section alone since you already selected the cells via a selection but if you need to fix you can do here.
d. check the 'Stop If True'
Click Apply/OK
(optional) Repeat with another selection area if needed (if the square selection didnt cover all the areas you wanted).
This should work. If you need to unset it... highlight the cells and remove this top 'override' rule or set it to '=FALSE()' (without the apostrophe's) if you think you'll be switching formatting off/on constantly vs just temporarily.
How can I get the current Fill Color in the ribbon using VBA? I like to manually select the Fill color to highlight entire rows with. I know I can highlight an entire row with code like foo.EntireRow.Interior.ColorIndex = 3. However, instead of setting it to 3, I want to set it to the user's currently selected Fill Color in the ribbon.
I found a similar thread for Microsoft Word that uses Options.DefaultHighlightColorIndex, but I have not found one for Microsoft Excel.
Edit: Sorry for the duplicate question. I am hoping there’s a better answer that doesn’t require an active selection first. If not I’ll accept Jonathan’s answer. Currently I am just highlighting the current cell with CellFillColorPicker, getting that cell’s color and then highlighting the row with that color.
This question appears to be similar to this one: VBA - use color already select in Excel to fill cell interior
It looks like this is the code that you want:
Application.CommandBars.ExecuteMso "CellFillColorPicker"
How does one stop the Delete method from deleting the cells formatting too.
When I use
rng.Hyperlinks(1).Delete
it deletes the cell formatting along with the cells conditional formatting.
Is this by design?
If you're getting rid of all the hyperlinks, you can use rng.clearhyperlinks and the formatting should persist.
FWIW, although I don't know for sure, I suspect the issue is that adding a hyperlink applies the Hyperlink style to the cell and someone thought it would be a good idea to clear the formatting when the link was deleted. Just wasn't fully, or well, implemented!
Whenever I copy or move a cell in excel, the original cell location changes colour, how can I stop this?
I have tried clearing the format but it doesn't seem to help... and it only occurs in the main area that I am working in (i.e. if I scroll off to the side or bottom it doesn't seem to happen).
Anyone have any ideas? It's quite annoying.
Conditional Formatting should do the trick. Highlight the cells that concern you and use the option if Cell contains value... then select blank. The format should be auto background (or whatever color you would like)
You may find a custom format already there causing the issue. If so just delete it and you should be all set.
I can't for the life of me figure out why certain cells are shaded in a spreadsheet template I downloaded. I confirmed that the cell's shading property is set to no color. The cell has a simple formula: =SUM(J8:K8).
If the background color is being set by code in another cell, I'm not sure how to find it. Searching for the cell name (ex: B7) doesn't come up with anything. Any suggestions what could be setting the background color?
Have you had a look at the Conditional Formating options?
It could be that there's a background colour set in there.
In Office 2007 it's on the Ribbon in the Styles section on the Home tab - your best bet is to go for the "Manage Rules..." option, and then check the rules for each worksheet.