I want to set a Excel cell two values.one is visible,another will show in the edit box when the cell activited.Just like a formula.,except the formula is a normal number.Can this work by vba?Can somebody help me with this please?
The formula bar will always show the value of the cell.
The cell itself can have formatting applied that changes the display of the value. For example, the screenshot shows a cell with a custom number format of
Cu\sto\m fo\r\m\at #
The formula bar and the cell cannot contain two different values, not even with VBA.
Related
I have an excel sheet that I am integrating some VBA code to it, but I am not been able to figure the following out.
On Cell G8 I have a drop-down list where I have the a description of the values on cells G9:G12, which are the following: Percentage, Discount, Premium. And on cells G9:G12 I have empty cells where I input my numbers.
Is it possible when I select for example, Percentage on cell G8, the number formating on cells G9:G12 change to "Percent"? And when I select Discount or Premium, the number formating changes to "Currency"?
Thank you!
Although Bigben is close in this comment (using conditional formatting with a formula like =$G$8="Percentage", it did not work in my case: I needed to put the value of the corresponding text ("Percentage"=1, "Discount"=2 and "Premium"=3), which changes the formula into:
=$G$8=1
I am trying to highlight a cell inside a table which i like to show by entering the cell address(eg:$G$7) in another cell. Can anyone good in Excel help me and explain and guide me the steps to achieve this. Many thanks!
This can be done with conditional formatting using a formula like:
=AND(ROW()=ROW(INDIRECT($A$1)),COLUMN()=COLUMN(INDIRECT($A$1)))
(note this formula assumes you will enter the address of the cell in A1)
To apply it, select all the relevant cells (the ones you want the formatting on), then add conditional formatting to then with the above formula.
thanks in advance for the help.
I'm making a Gantt chart in Excel and am trying to integrate the capability to highlight the work week (WW). The idea is that one can select the WW from a drop down menu and the corresponding columns in the chart are highlighted. I am struggling with the conditional formatting formula to highlight the desired dates.
Here's a screen shot of how the chart is set up
I am able to highlight the column of the cell containing the WW value (e.g. in picture column I is highlighted as it contains "WW42" in cell I3. I would like to be able to highlight the days from Sunday to Saturday of each WW.
Most formulas (that I know) work on the value of the cells rather than their location or index. I have tried simply filling in all the blank cells with the WW value and then hiding the value, but the formatting isn't aesthetically pleasing and it's not efficient.
I have also tried merging the WW cells, but am unable to select all columns of the length of the merged cell, just the first column associated. For example, if I merged I3 to O3, conditional formatting will highlight that merged cell and only column I.
Any suggestions on how to approach this is greatly appreciated!
Attached is a screenshot of my structure with my conditional formating working as required. You'll need to adjust acording to your structure, but I used a formula-based conditional formating, with the rule:
=COUNTA($B$2:B$2)=$A$1 //Where A1 contains the workweek I want to highlight
Entered into cells $B$3:$V$6. Of course, in your case you'd have to change it to something like:
=COUNTA($B$2:B$2)+41-3=$A$1
Since your work weeks start at 42 and you have 3 extra headings you dont want added on your sum (ACTUAL START, ACTUAL DURATION and PERCENT COMPLETE). Also the header for the work week has to be a numeric value, but you can play around this to get what you need. Let me know if you'd need further help.
You do not need to use the third row for your conditional formatting, if row 4 has legal excel dates. The WEEKNUM() formula gives you exactly what you need.
If your Dropdown Menu is in cell B2 and consists of numbers from 1-52 then this should work for your conditional formatting:
=$B$2=WEEKNUM(D$1)
See attached photo.
I want to apply a conditional formatting (CF) rule to a group of cells to individually colour them if their individual cell values are greater than a threshold (in this case >=5). To illustrate:
The top row shows how I want the bottom row to look. For the bottom row I cannot figure out how correctly format according to cell-specific formulae.
The problem is identifying a way to specify cell-specific CF formulas in a single operation for a group of cells - as you can by pasting/dragging normal cell formulas. I obviously don't want to have to manually specify the formula for each cell!
Grateful for assistance.
Select the rows or columns or range that you want to conditional format,
Enter the below formula in the formula bar in conditional format and choose a fill color,
=AND(A1>=5,ISNUMBER(A1))
If you are starting in row3, change the A1 to A3. The $ that you have in the formula makes it absolute. It should be relative.
You just select all required cells to format. Then go to conditional formatting.
Check what is the cell shown just before the formula bar (the single cell that represents the selected range, also called default cell) and use that cell in your formula without absolute reference. like B3>=5 or R3>=5
I want a macro to find all the words written a column in another excel & make them bold.
For EX: I have Words like new, grow, etc written in a column B of Excel an the macro has to Find theses words individually in another excel & make them bold and change the Background of the cell to Red Color.
Thanks in Advance.
You may want to have a look into conditionnal formatting.
Assume for example you have the values you want to look for in column B, and you want to highlight all values in a range, say, D4:F15.
Select the range D4:F15, make a new formatting rule and choose "Use a formula to determine which cells to format". Enter =ISNUMBER(MATCH(D4;$B:$B)) as formula, and make the format as you wish. Note that D4 in the formula has to be the first cell of the range.
If you don't need more than that, the benefit is that you don't need a macro at all, and the formatting can be done in real time too.